go/pkg/dev
Snider 92264f29f4
feat(dev): add safe git operations for AI agents (#71)
* feat(dev): add safe git operations for AI agents

Adds agent-safe commands to prevent common git mistakes:

- `core dev sync <file> --to="pattern"`: Sync files across repos
  - Auto-pulls before copying (safe sync)
  - Optional commit with --message
  - Optional push with --push
  - Dry-run mode with --dry-run

- `core dev apply --command="..."`: Run commands across repos
  - Execute shell commands in each repo
  - Execute scripts with --script
  - Optional commit/push after changes
  - Continue on error with --continue
  - Filter repos with --repos

Safety features:
- Never force push
- Auto-pull before push on rejection
- Report failures without stopping other repos
- Dry-run support for previewing changes

Closes #53

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(dev): address CodeRabbit review feedback

- Use errors.E() for consistent error handling in cmd_apply.go and cmd_file_sync.go
- Add path traversal validation to reject ".." in source paths
- Execute scripts directly to honor shebangs (not via sh)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:11:24 +00:00
..
cmd_api.go refactor(plugin): rename plugin files and update command structure 2026-01-31 11:39:19 +00:00
cmd_apply.go feat(dev): add safe git operations for AI agents (#71) 2026-02-01 06:11:24 +00:00
cmd_bundles.go refactor(cli): move commands from cmd/ to pkg/ with self-registration 2026-01-30 21:55:55 +00:00
cmd_ci.go refactor: migrate all pkg/* to cli abstraction 2026-01-31 23:54:01 +00:00
cmd_commit.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_dev.go feat(dev): add safe git operations for AI agents (#71) 2026-02-01 06:11:24 +00:00
cmd_file_sync.go feat(dev): add safe git operations for AI agents (#71) 2026-02-01 06:11:24 +00:00
cmd_health.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_impact.go refactor: migrate all pkg/* to cli abstraction 2026-01-31 23:54:01 +00:00
cmd_issues.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_pull.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_push.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_reviews.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_sync.go refactor(plugin): rename plugin files and update command structure 2026-01-31 11:39:19 +00:00
cmd_vm.go refactor: migrate all pkg/* to cli abstraction 2026-01-31 23:54:01 +00:00
cmd_work.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00
cmd_workflow.go feat(qa,dev): add issues, health, and workflow commands (#67) 2026-02-01 05:20:46 +00:00
cmd_workflow_test.go feat(qa,dev): add issues, health, and workflow commands (#67) 2026-02-01 05:20:46 +00:00
registry.go fix(i18n): restore missing translation keys for health command (#65) 2026-02-01 03:55:01 +00:00
service.go feat(workspace): implement workspace.yaml support 2026-02-01 02:18:19 +00:00