Expand description
taskfast init — the onboarding command.
Replaces init.sh’s step 1-9 orchestration with a non-interactive,
CLI-driven flow. Every input comes from a flag, an env var, or the
existing Config file — there are no TTY prompts, because the
caller is expected to be another agent/LLM.
§Scope (this slice, am-yvc)
- api_key: direct via
--api-key/TASKFAST_API_KEY/ config file. - validate:
GET /agents/me— must be active. - readiness:
GET /agents/me/readiness— informs wallet gate. - wallet: BYOW via
--wallet-address, or generate + keystore with a password sourced from--wallet-password-file/TASKFAST_WALLET_PASSWORD. - config file: load + write at
ctx.config_path(default./.taskfast/config.json, chmod 600 on unix). - final readiness assert.
§Scope (am-z58 extension)
--human-api-key(+ optional agent-* fields): when no agent key is available, POST /agents with the user PAT to mint one. The server derivesowner_idfrom the PAT, so the CLI never asks the caller for it. The mintedapi_keyis then used for the rest of the flow and written to the config file. Under--dry-runthe mint is skipped and the envelope reportsagent.action = "would_mint"— the rest of the flow is also skipped because the real agent key never materialized.
§Scope (am-iit extension)
- Optional
--webhook-url(+--webhook-secret-file, repeat--webhook-event) folds webhook registration into the init run: PUT /agents/me/webhooks, persist the returned secret (chmod 600), and optionally replace the subscription list. Skipped silently when the URL isn’t supplied so callers who prefer a separatetaskfast webhook registerstep still get the pre-am-iit flow.
Deferred to separate beads so this slice stays reviewable:
am-c74— balance polling after faucet dispense.
§Scope (gh#142 extension)
- End-of-init funding sanity check: a failed
--fundfaucet request or a zero wallet balance prints a prominent stderr warning with the manual fallback (cast rpc tempo_fundAddress …against the deployment’s advertised rpc_url, or https://wallet.tempo.xyz) and the server’sfunding_hintwhen the readinessfundedgate emits one. The run staysok:true— the gap is a warning, not a failure.
§--dry-run semantics
Mutations short-circuit: no wallet POST, no config file write, no keystore write. A wallet is still generated (so the address is real) but its signer is dropped at the end of the function. Readiness and profile reads pass through.
Structs§
Functions§
- run
- run_
with_ prompter - Same as
runbut with an injectablecrate::cmd::init_tui::Prompterand an explicitinteractivegate so tests can drive the TUI branches undercargo test(where neither stdin nor stdout is a TTY). Production callers should userun.