Skip to content

feat(cli): seed a default local context in dirctl init - #1764

Merged
akijakya merged 2 commits into
mainfrom
feat/init-dirctl-context-config
Jul 9, 2026
Merged

akijakya merged 2 commits into
mainfrom
feat/init-dirctl-context-config

Conversation

@akijakya

@akijakya akijakya commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Current wizard texts:

$ dirctl init

Welcome to dirctl — the CLI for the AGNTCY Directory, a distributed registry
of AI agent records described in OASF.

This wizard sets up your local environment. Steps:
  1. Configure a local client context
  2. Provision the OASF taxonomy extractor
  (more steps — MCP server & skills — coming soon)

Step 1 — Client context
Point dirctl at a Directory node. This adds a "local" context (server localhost:8888, insecure
auth) and makes it the default, so push/search/pull reach a local daemon
without --server-addr.
Configure a "local" context → localhost:8888? [Y/n]:
✔ Context "local" configured and set as current (server localhost:8888).

Step 2 — OASF taxonomy extractor
Maps free-form text onto the OASF taxonomy so dirctl can enrich records and
(soon) answer free-text searches locally — in-process, with no LLM or API
calls. It needs a one-time ~89 MB model + the taxonomy downloaded to your
machine; provisioned once, reused everywhere.

Provision the OASF extractor (~89 MB)? [Y/n]:
OASF URL [https://schema.oasf.outshift.com]:

Provisioning extractor assets to /Users/*****/.agntcy/oasf-sdk/extractor
✔ Extractor ready.
  asset dir: /Users/ajaky/.agntcy/oasf-sdk/extractor
  OASF URL:  https://schema.oasf.outshift.com
Enrichment and free-text search can now run locally.

Closes #1762

@akijakya akijakya self-assigned this Jul 7, 2026
@akijakya
akijakya requested a review from a team as a code owner July 7, 2026 14:37
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jul 7, 2026
@akijakya
akijakya requested a review from Copilot July 7, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends dirctl init to seed a default local client context (pointing at localhost:8888) so a fresh install can talk to a local Directory node without manual config.yaml edits, aligning with the onboarding goals in #1762.

Changes:

  • Add client/config.SaveContext to write a named context (optionally setting current_context) while keeping existing known config sections.
  • Add an init wizard step (runContextSetup) that seeds a default local context when no contexts are configured (opt-out on TTY; skipped non-interactively unless --yes).
  • Update/init tests to cover context seeding behavior and config preservation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
client/config/config.go Adds SaveContext writer to persist a context and optionally set it current.
client/config/config_test.go Adds unit tests for SaveContext seeding and preservation behavior.
cli/cmd/init/run.go Reorders init flow to include a new Step 1 (context setup) before extractor provisioning (Step 2).
cli/cmd/init/context.go Implements the context-setup wizard step and default local context definition.
cli/cmd/init/context_test.go Adds tests for context setup (seed, skip when configured, skip non-interactively without --yes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/config/config.go Resolved
Comment thread client/config/config.go Resolved
@akijakya
akijakya force-pushed the feat/init-dirctl-context-config branch from ede14a5 to f2d941f Compare July 9, 2026 08:37
@akijakya
akijakya enabled auto-merge (squash) July 9, 2026 08:39
@akijakya
akijakya merged commit 7985d47 into main Jul 9, 2026
31 of 32 checks passed
@akijakya
akijakya deleted the feat/init-dirctl-context-config branch July 9, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): seed a default local context in dirctl init

3 participants