feat: Monorepo support with root-level app configuration
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with internal/project/config.go and trace the existing env, exec, and init command entry points to understand single-app configuration and preserve its behavior. Implement monorepo detection, app resolution, bulk writing, validation, and interactive initialization, then add tests for config detection and app resolution and update the documentation with the specified examples.
Written by the indexing model from the issue text.
Description
Summary
Add monorepo support to allow a single root-level .secrets.json to manage credentials for multiple apps, eliminating the need for per-directory config files.
Problem
The current .secrets.json model is per-directory, which creates friction for monorepos. In repos like course-builder with 15+ apps, each app needs different Vercel project credentials. Right now you'd need:
- 15 separate
.secrets.jsonfiles - Manual navigation to each app directory to sync secrets
- No unified view of credential configuration
This is clunky as hell.
Proposed Solution
Introduce a type: "monorepo" schema where a root-level .secrets.json contains an apps map. Each app gets its own source configuration and can be synced individually or in bulk.
Schema Example
{
"type": "monorepo",
"apps": {
"ai-hero": {
"source": "vercel",
"project": "ai-hero",
"scope": "production"
},
"epic-web": {
"source": "vercel",
"project": "epic-web",
"scope": "production"
},
"marketing-site": {
"source": "vercel",
"project": "marketing-site",
"scope": "production"
}
},
"ttl": "1h"
}
CLI Usage
# Sync secrets for a specific app
secrets env ai-hero
# Sync all apps at once
secrets env --all
# Run a command with a specific app's secrets
secrets exec ai-hero -- bun dev
# Initialize a monorepo config interactively
secrets init --monorepo
Implementation Hints
-
Config Detection (
internal/project/config.go)- Update
FindProjectConfigto detecttype: "monorepo" - Add
MonorepoConfigstruct withApps map[string]AppConfig - Keep backward compatibility with existing single-app configs
- Update
-
Command Updates
envcommand: accept optional app name as first arg; require--allflag for bulk syncexeccommand: accept app name as first arg before--delimiterinitcommand: add--monorepoflag to scaffold monorepo config
-
App Resolution Flow
// Pseudocode if config.Type == "monorepo" { if appName == "" { return error "app name required for monorepo" } appConfig := config.Apps[appName] // use appConfig.Source, appConfig.Project, etc. } -
File Writing (
envcommand)- For monorepo mode with specific app: write
.env.localin app subdirectory (e.g.,apps/ai-hero/.env.local) - For monorepo mode with
--all: iterate apps and write each app's.env.localin its subdirectory - For legacy single-app mode: keep current behavior (write to project root)
- For monorepo mode with specific app: write
-
Validation
- Ensure app names in
appsmap are valid directory names - Validate each app's source config (Vercel project exists, etc.)
- Provide clear errors if app name doesn't exist in config
- Ensure app names in
Acceptance Criteria
- Root-level
.secrets.jsoncan definetype: "monorepo"withappsmap -
secrets env <app-name>syncs secrets for specified app -
secrets env --allsyncs secrets for all apps in monorepo -
secrets exec <app-name> -- <cmd>runs command with app-specific secrets -
secrets init --monorepocreates monorepo-style config interactively - Backward compatibility: existing single-app configs continue working
- Clear error messages when app name is missing or invalid
- Documentation updated with monorepo examples
- Tests cover monorepo config detection and app resolution
Related
This unblocks course-builder and any other monorepo with multiple Vercel deployments needing distinct credential sets.
- Dominant language
- Go
- Stars
- 109
- Forks
- 7
- Avg merge
- 2h 37m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from joelhooks/agent-secrets
-
Daemon does not reload existing secrets.age store on restart (secrets_count silently returns 0) Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
joelhooks/agent-secrets#22 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
joelhooks/agent-secrets#17 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
joelhooks/agent-secrets#16 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
joelhooks/agent-secrets#15 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
joelhooks/agent-secrets#14 ·
All issues in joelhooks/agent-secrets
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100