gest
gest manages agent-generated artifacts and task backlogs alongside your project.This crate root holds AppContext and the startup sequence: parse the command line, load the
configuration, open the store, find the current project, and dispatch to cli::App.
| Name | Summary |
|---|---|
actions |
Actions that several commands share, written once over the entity kinds. |
cli |
CLI entry point and command dispatch for gest. |
config |
Layered configuration loading and typed settings for the gest CLI. |
io |
I/O utilities (editor launching, terminal detection, etc.). |
logging |
Logging infrastructure for gest. |
store |
SQLite-backed store: connection management, migrations, models, and repos. |
ui |
UI rendering and style infrastructure. |
web |
Web server for the gest dashboard. |
struct AppContext
pub struct AppContextShared application state threaded through every subcommand.
| Field | Type | Description |
|---|---|---|
gest_dir |
Option<PathBuf> | The .gest directory path, if the project is in local mode. |
no_pager |
bool | Whether the user passed --no-pager to suppress paging of long command output. |
project_id |
Option<Id> | The current project’s ID, if one has been initialized for the working directory. |
settings |
Settings | Resolved configuration settings (file + env overrides). |
store |
Arc<Db> | Database connection handle. |
AppContext::gest_dir
pub fn gest_dir(&self) -> &Option<PathBuf>The .gest directory path, if the project is in local mode.
| Parameter | Type | Description |
|---|---|---|
| returns | &Option<PathBuf> |
AppContext::no_pager
pub fn no_pager(&self) -> &boolWhether the user passed --no-pager to suppress paging of long command output.
| Parameter | Type | Description |
|---|---|---|
| returns | &bool |
AppContext::project_id
pub fn project_id(&self) -> &Option<Id>The current project’s ID, if one has been initialized for the working directory.
| Parameter | Type | Description |
|---|---|---|
| returns | &Option<Id> |
AppContext::settings
pub fn settings(&self) -> &SettingsResolved configuration settings (file + env overrides).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
AppContext::store
pub fn store(&self) -> &Arc<Db>Database connection handle.
| Parameter | Type | Description |
|---|---|---|
| returns | &Arc<Db> |
fn main
fn main() -> ExitCodeRun the CLI on a Tokio runtime and print any error to stderr.
| Parameter | Type | Description |
|---|---|---|
| returns | ExitCode | ExitCode::SUCCESS, or the sysexits code of the error from Error::exit_code. |
fn run
async fn run() -> Result<(), Error>Drive the CLI from argv to result. All error paths funnel through cli::Error
so main can compute a sysexits.h-compliant exit code via
cli::Error::exit_code.
| Parameter | Type | Description |
|---|---|---|
| returns | Result<(), Error> | Ok(()) when the command and the final store export succeed, or the first error. |
fn resolve_project
async fn resolve_project(store: &Arc<Db>) -> Result<(Option<Id>, Option<PathBuf>), Error>Resolve the current project ID and .gest directory from the working directory.
Returns (None, None) when the current directory is not itself registered
as a gest project (the common case for bootstrapping commands like init)
and no .gest directory at or above it holds a synced project.yaml; when
one does, that project is found or created.
| Parameter | Type | Description |
|---|---|---|
store |
&Arc<Db> | the opened store, used to look up the project |
| returns | Result<(Option<Id>, Option<PathBuf>), Error> | The project ID and its .gest directory, each None when it is not found. |
fn prepare_startup_gest_dir
fn prepare_startup_gest_dir(app: &App) -> Result<Option<PathBuf>, Error>Discover or create the .gest directory before the store opens.
init --local is special: it must create .gest early so the first store
open can use .gest/gest.db instead of briefly touching the global data
directory.
| Parameter | Type | Description |
|---|---|---|
app |
&App | the parsed command line, checked for init --local |
| returns | Result<Option<PathBuf>, Error> | The .gest directory to open the store from, or None to use the global store. |
fn find_ancestor_gest_dir
fn find_ancestor_gest_dir(start: &std::path::Path) -> Option<PathBuf>Walk from start upward looking for a project .gest directory.
| Parameter | Type | Description |
|---|---|---|
start |
&std::path::Path | the directory where the search begins |
| returns | Option<PathBuf> | The first .gest directory found, nearest first, or None when no ancestor has one. |