# GreenAsh v0.3.0 - Table of Contents

> A keyboard-driven LiveView console to probe your Ash resources — zero UI code.

## Pages

- [GreenAsh](readme.md)
- [Changelog](changelog.md)
- [LICENSE](license.md)

## Modules

- [GreenAsh](GreenAsh.md): GreenAsh — a "green screen" test console (LiveView, 100% keyboard-driven,
AS400 style) generated by introspection from your Ash resources, with no UI
code.

- Core
  - [GreenAsh.Actor](GreenAsh.Actor.md): Management of the console's "actor": the Ash record on whose behalf actions
are executed (to exercise the policies). Stored in the HTTP session (a
LiveView cannot write the session via the socket: see
`GreenAsh.ActorController`) and re-threaded through all Ash calls.

  - [GreenAsh.Command](GreenAsh.Command.md): Parser + application of the `:` command line (Vim-style), shared by all
screens. Paths are built from the mount base (`base`) provided by the host,
and resources are resolved among `domains`.
  - [GreenAsh.Field](GreenAsh.Field.md): Introspection of an Ash action -> field specs -> HTML widget type.
  - [GreenAsh.Registry](GreenAsh.Registry.md): Runtime discovery of Ash resources / actions from the list of domains
provided by the host (via the router macro), and module <-> slug / primary
key resolution for the console's routes.
  - [GreenAsh.Tenant](GreenAsh.Tenant.md): The console's current tenant: the value threaded through every Ash call so
that multitenant resources can be browsed.

- Web Integration
  - [GreenAsh.Components](GreenAsh.Components.md): Self-contained UI components for the console: the full-screen "green
terminal" stylesheet, a generic `<.input>` (driven by an AshPhoenix form
field), and a `<.button>`. No dependency on the host's components.

  - [GreenAsh.OnMount](GreenAsh.OnMount.md): `on_mount` set by the router macro: injects into each LiveView the list of
domains, the mount base, the current tenant, and the current actor
(resolved from the session, within that tenant).
  - [GreenAsh.Router](GreenAsh.Router.md): Integration into the host's router.
  - [GreenAsh.SessionController](GreenAsh.SessionController.md): Writes/clears the console's actor and tenant in the session, then redirects.
  - [GreenAsh.Web](GreenAsh.Web.md): Entry point `use GreenAsh.Web, :live_view` for the console's LiveViews.
Imports nothing from the host application: only Phoenix.LiveView, the
lib's components, and a path helper relative to the mount base.

- LiveViews
  - [GreenAsh.Live.Menu](GreenAsh.Live.Menu.md): Main menu, AS400-style: full screen, numbered options, `Option ===>`
command line, and keyboard navigation. Two levels discovered automatically
(resources -> actions). A `:create` action opens the entry screen, `:read`
opens a list; `:update`/`:destroy` redirect to a list.

  - [GreenAsh.Live.Screen](GreenAsh.Live.Screen.md): Generic engine: renders an executable entry screen for ONE Ash action,
entirely through introspection. The resource/action come from the route;
the fields are inferred by `GreenAsh.Field` and the form by
`AshPhoenix.Form`. An `:id` (PK token) loads a record for an update action.

  - [GreenAsh.Live.Subfile](GreenAsh.Live.Subfile.md): AS400 subfile: lists the records of a `:read` action, with an "Opt" column
per row (codes derived from the actions: update/destroy/display), a filter
(arguments of the read action, on the query side), column sorting, and
pagination. All reads/deletes pass through the current actor.

## Mix Tasks

- Mix Tasks
  - [mix green_ash.install](Mix.Tasks.GreenAsh.Install.md): Installs GreenAsh: mounts the console in your router

