gentic host connect <code>, which exchanges a single-use enrollment code for a stable host id, API URL, and host-specific credential. The CLI saves those values to a persistent config file on disk with owner-only permissions. Environment variables — including a .env file loaded at startup — are the alternative, and are the right choice for containers, CI systems, or local development where you manage secrets through the environment. When the same key appears in both sources, the environment variable takes precedence over the config file.
First-run behavior
When you run agentic command for the first time, the CLI checks whether the host is ready before it continues. This onboarding gate runs for normal host commands, including gentic start and gentic run. It does not run for gentic host connect, gentic onboard, gentic status, gentic doctor, gentic auth, --help, or --version, so you can always connect a host, resume setup, or inspect the CLI without completing onboarding first.
If the command is running in an interactive terminal and any required setup is missing, Gentic starts the first-run flow automatically. The flow has four steps:
- Gentic auth — verifies that this machine has a stored host id, API URL, and host credential from
gentic host connect <code>. This is required. - GitHub CLI — checks that
ghis installed and authenticated, and offers to install or rungh auth loginwhen possible. This is required because agents use GitHub CLI access to open pull requests. - Agent CLI — checks both Claude Code and Codex. Both agent CLIs must be installed and authenticated because the host can claim issues for either provider.
- Host service — shows a summary and asks whether to enable the background host service with
gentic start. This step is optional; you can decline and rungentic startlater.
gh, Claude Code, and Codex to be installed and authenticated before the host command starts. If any required item is missing, Gentic exits with the unmet requirements instead of prompting.
Host Enrollment via CLI
The recommended way to configure credentials is withgentic host connect <code>. This command reads and writes an OS-appropriate config file — for example, ~/.config/gentic/config.json on Linux — that persists across restarts without needing a .env file.
GENTIC_HOST_CREDENTIAL is issued by the enrollment exchange. Do not reuse
a shared API key. Losing the config file loses this machine’s host identity; the
next enrollment creates a new host instead of reclaiming by hostname.Connect
Generate a host enrollment code in the Gentic web app, then connect this machine:Check authentication status
Display the currently configured API URL and a masked version of your host credential:Log out
Clear the stored credentials from the config file. Run with--yes (or -y) to skip the confirmation prompt:
GENTIC_HOST_ID, GENTIC_HOST_CREDENTIAL, GENTIC_API_URL, and GENTIC_HOST_SETUP_STATE. Other settings stored in the config file — such as GIT_REMOTE_BASE, WORKDIR, and POLL_INTERVAL_MS — are preserved.
Upgrading from a pre-0.26 CLI
Before 0.26.0 a host was called a “worker”, and these three settings were namedGENTIC_WORKER_ID, GENTIC_WORKER_CREDENTIAL, and GENTIC_WORKER_SETUP_STATE. The CLI still reads the old names from both the config file and the environment, so an existing host does not need to be re-enrolled — upgrade the CLI and it keeps its identity. The config file is rewritten under the new names the next time anything changes it.
Environment variables (alternative)
Environment variables give you fine-grained control over every configuration value and are an alternative to the persisted config file — useful for local development, containers, or CI systems where you manage secrets through the environment directly. Create a.env file in the directory where you run gentic and fill in the values for your environment:
Required
string
required
The Gentic API endpoint. Use
https://app.gentic.chat/api/v1 for the hosted service, or http://localhost:3000/api/v1 when developing against a local web app instance.string
required
The stable host id returned by
gentic host connect <code>. Keep it paired with its credential so service and process restarts preserve the same host identity.string
required
A host-specific credential issued by the enrollment exchange. The hosted API verifies the host credential and only returns issues that belong to its user.
Optional
string
default:"git@github.com:"
The base URL prepended to each project’s
owner/repo path when the host clones a repository. With the default value, a project stored as acme/backend is cloned from git@github.com:acme/backend.Change this if your repositories are hosted on GitHub Enterprise, GitLab, or another Git provider:number
default:"1"
The maximum number of issues this host processes at the same time. Each active issue uses its own repository clone and realtime channel. Increase this only when the machine has enough CPU, memory, disk, and agent-provider capacity.
string
default:"~/.local/share/gentic/workspaces (Linux)"
The directory where the host creates per-issue repository clones. Each issue gets its own subdirectory. If unset, the host uses an OS-appropriate data directory determined by
env-paths:- Linux:
~/.local/share/gentic/workspaces - macOS:
~/Library/Application Support/gentic/workspaces
number
default:"3000"
How often (in milliseconds) the host polls the Gentic API for issues with
status = 'todo' (or status = 'held' past their usage-limit reset time). The default of 3000 ms (3 seconds) works well for most setups. Increase this value to reduce API traffic on low-priority hosts.Configuration precedence
The host merges all configuration sources in the following order, with later sources winning:- Config file — written by
gentic host connect <code>(e.g.~/.config/gentic/config.json) .envfile — loaded from the working directory at startup- Shell environment variables — exported in the process environment at runtime
gentic host connect <code> and use environment variables only for per-deployment overrides like WORKDIR or POLL_INTERVAL_MS.
After editing the config file, apply runtime settings without interrupting active issues:
MAX_CONCURRENT_ISSUES, POLL_INTERVAL_MS, WORKDIR, GIT_REMOTE_BASE, and setup state apply to subsequent host activity. If the new concurrency limit is below the number of issues already running, those issues continue and the host waits before claiming more. Host identity, credential, and API URL changes require gentic restart because they belong to the existing API connection.
