feat: per-project config scope for one init#78
Merged
Conversation
`one init` now asks whether the setup should live globally (~/.one/config.json) or per-project (~/.one/projects/<slug>/config.json). At read time the CLI prefers the project config and falls back to global, so users can have different API keys / connections per folder without touching their default setup. Adds `one config path` to show the active scope and full fallback chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
moekatib
commented
Apr 9, 2026
|
|
||
| You have access to the One CLI which lets you interact with 250+ third-party platforms through their APIs. Always include the `--agent` flag right after `one` for structured JSON output. | ||
|
|
||
| ## Config scopes |
Contributor
Author
There was a problem hiding this comment.
no need for this in the skill - no need to overload the skill.
Maybe add a reference for scoping to help the agent walks the user on how to do it using the init (better than the .onerc)
moekatib
commented
Apr 9, 2026
| ## Setup | ||
|
|
||
| 1. Run \`one init\` to configure your API key | ||
| 1. Run \`one init\` to configure your API key. It asks whether to save the config globally (\`~/.one/config.json\`, applies everywhere) or per-project (\`~/.one/projects/<slug>/config.json\`, applies only inside that folder). Project configs take precedence over the global config when running \`one\` inside the project; otherwise the global config is used as a fallback. |
Contributor
Author
There was a problem hiding this comment.
too much details - not needed
- SKILL.md: drop inline config-scopes section, replace with a pointer to a new references/scoping.md that teaches the agent to walk users through `one init` (not .onerc) when they want project-scoped setups - guide-content.ts: trim the setup step back to one line Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
one initnow picks between global (~/.one/config.json) and project (~/.one/projects/<slug>/config.json) scope via an interactive picker — project config wins at read time, global is the fallbackresolveConfig()insrc/lib/config.tscentralizes the project→global lookup; all existing accessors route through it so every command becomes scope-aware for freeone config pathcommand (human +--agentJSON) prints the active scope and full fallback chain so it's obvious which config is being used[project]/[global]tags) and a completion screen that explains the resolution order in plain EnglishTest plan
~/.one/config.json— behavior identical to before, no project dir createdone initdefaults the picker to project when a global already exists~/.one/projects/<slug>/config.jsonis created with 0600,one config pathreportsscope: projectcdto an unrelated directory —one config pathreportsscope: globalandone listuses the global keyone init --global/--projectskip the picker (for scripts / agents)🤖 Generated with Claude Code