brady-cli 1.1.0 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/prompts/plan-bradyCliSkillsCommands.prompt.md +47 -0
- package/.github/workflows/main.yml +18 -0
- package/.github/workflows/publish.yml +30 -0
- package/.releaserc.json +21 -0
- package/CHANGELOG.md +10 -4
- package/README.md +111 -0
- package/dist/index.js +2226 -655
- package/package.json +39 -28
- package/src/index.js +192 -0
- package/src/index.ts +232 -58
- package/tsconfig.json +94 -92
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.eslintrc.json +0 -3
- package/src/eslintConfig.json +0 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Plan: brady-cli revival + skills commands
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
- Repo: `c:\Users\brady\Documents\Repositories\brady-cli`
|
|
6
|
+
- dotfiles repo: `bharper77/dotfiles` (private), skills at `.agents/skills/{skill-name}/` (folders with SKILL.md + other md files)
|
|
7
|
+
- Skills land in: `.agents/skills/` relative to cwd
|
|
8
|
+
- GitHub access: `gh api` (gh CLI). Pre-flight: run `gh auth status` before any api call; on failure, throw actionable error "Run `gh auth login` to authenticate, then retry." Offer to spawn `gh auth login` inline if not authed.
|
|
9
|
+
- TUI library: `@clack/prompts`
|
|
10
|
+
- Windows-only CLI (exec uses powershell.exe)
|
|
11
|
+
- Current structure: single `src/index.ts` file with `init` command
|
|
12
|
+
|
|
13
|
+
## Key Technical Decisions
|
|
14
|
+
|
|
15
|
+
- gh api for fetching: `gh api repos/bharper77/dotfiles/contents/.agents/skills`
|
|
16
|
+
- Files are base64-encoded in GitHub API response → decode with `Buffer.from(content, "base64")`
|
|
17
|
+
- Commander subcommand nesting: `program.command("skills")` → `.addCommand(listCmd)` + `.addCommand(addCmd)`
|
|
18
|
+
- `brady skills add [skill]` — optional positional arg: if present download directly, else show @clack/prompts multiselect
|
|
19
|
+
- Add `"brady": "node dist/index.js"` script to package.json for `pnpm brady skills list` local dev invocation
|
|
20
|
+
- Move `@changesets/cli` from dependencies → devDependencies
|
|
21
|
+
|
|
22
|
+
## Plan
|
|
23
|
+
|
|
24
|
+
### Phase 1: Dependencies & Tooling
|
|
25
|
+
|
|
26
|
+
1. Update package.json: bump all deps to latest, add @clack/prompts (prod), move @changesets/cli to devDeps, add packageManager field
|
|
27
|
+
2. Install deps with pnpm (user runs this)
|
|
28
|
+
|
|
29
|
+
### Phase 2: Skills Commands in src/index.ts
|
|
30
|
+
|
|
31
|
+
3. Add skills parent command, list subcommand, add subcommand
|
|
32
|
+
4. Helper: fetchGhJson(apiPath) — runs `gh api {path}` via execSync, returns parsed JSON
|
|
33
|
+
5. Helper: downloadSkill(skillName) — fetches file list for `.agents/skills/{skillName}`, decodes base64 content, writes files to `.agents/skills/{skillName}/` relative to process.cwd()
|
|
34
|
+
6. ensureGhAuth() — runs `gh auth status`; on failure, uses @clack/prompts to ask if user wants to run `gh auth login` now; if yes, spawns it interactively; if no, exits with actionable error message
|
|
35
|
+
7. listSkills() — calls ensureGhAuth(), fetches skill dirs, prints each skill name
|
|
36
|
+
8. addSkill(skill?) — calls ensureGhAuth(); if skill arg provided: downloadSkill directly; else fetch list, @clack/prompts multiselect (space = toggle, enter = confirm), downloadSkill for each selected
|
|
37
|
+
|
|
38
|
+
### Phase 3: README
|
|
39
|
+
|
|
40
|
+
9. Create README.md covering: installation, commands (brady init, brady skills list, brady skills add, brady skills add <name>), local dev workflow, changeset releasing workflow
|
|
41
|
+
|
|
42
|
+
## Dependency updates
|
|
43
|
+
|
|
44
|
+
- Update all existing deps to latest at implementation time (check npm registry)
|
|
45
|
+
- Note: `@commander-js/extra-typings` must match the major version of `commander`
|
|
46
|
+
- Move `@changesets/cli` from dependencies → devDependencies
|
|
47
|
+
- NEW: `@clack/prompts` (prod dep, latest)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- "**"
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: pnpm/action-setup@v4
|
|
13
|
+
- uses: actions/setup-node@v4
|
|
14
|
+
with:
|
|
15
|
+
node-version: 20.x
|
|
16
|
+
cache: "pnpm"
|
|
17
|
+
- run: pnpm install --frozen-lockfile
|
|
18
|
+
- run: pnpm run typecheck && pnpm run build
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- "main"
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write # Required to create tags and commits
|
|
9
|
+
issues: write # Required for semantic-release to comment on issues
|
|
10
|
+
pull-requests: write # Required for semantic-release to comment on PRs
|
|
11
|
+
id-token: write # Required for npm provenance
|
|
12
|
+
|
|
13
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
publish:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0 # Required for semantic-release to read full git history
|
|
22
|
+
- uses: pnpm/action-setup@v4
|
|
23
|
+
- uses: actions/setup-node@v6
|
|
24
|
+
with:
|
|
25
|
+
node-version: "24"
|
|
26
|
+
cache: "pnpm"
|
|
27
|
+
- run: pnpm install --frozen-lockfile
|
|
28
|
+
- run: pnpm run release
|
|
29
|
+
env:
|
|
30
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/.releaserc.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": ["main"],
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@semantic-release/commit-analyzer",
|
|
5
|
+
"@semantic-release/release-notes-generator",
|
|
6
|
+
"@semantic-release/changelog",
|
|
7
|
+
["@semantic-release/npm", { "npmPublish": false }],
|
|
8
|
+
[
|
|
9
|
+
"@semantic-release/exec",
|
|
10
|
+
{ "publishCmd": "npm publish --provenance --access public" }
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"@semantic-release/git",
|
|
14
|
+
{
|
|
15
|
+
"assets": ["CHANGELOG.md", "package.json"],
|
|
16
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"@semantic-release/github"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
## [1.2.6](https://github.com/BHarper77/brady-cli/compare/v1.2.5...v1.2.6) (2026-05-09)
|
|
2
2
|
|
|
3
|
-
## 1.1.0
|
|
4
3
|
|
|
5
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
* removed eslint from project init ([98a3c61](https://github.com/BHarper77/brady-cli/commit/98a3c61ff5c3cfec5d3449119ec7991b8bb2ea7a))
|
|
7
|
+
|
|
8
|
+
## [1.2.5](https://github.com/BHarper77/brady-cli/compare/v1.2.4...v1.2.5) (2026-05-09)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fixed NPM publishing ([3f6dc6e](https://github.com/BHarper77/brady-cli/commit/3f6dc6e8c8d6ac4804a7a5ecf4535567cbff3f98))
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# brady-cli
|
|
2
|
+
|
|
3
|
+
Personal CLI for project scaffolding and agent skill management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g brady-cli
|
|
9
|
+
# or
|
|
10
|
+
pnpm add -g brady-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires [GitHub CLI](https://cli.github.com/) (`gh`) to be installed and authenticated for skills commands.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
### `brady init`
|
|
18
|
+
|
|
19
|
+
Scaffold a new TypeScript Node.js project.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
brady init -d my-project
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Option | Description |
|
|
26
|
+
| ----------------------------- | ---------------------------------- |
|
|
27
|
+
| `-d, --directory <directory>` | Directory name for the new project |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### `brady skills list`
|
|
32
|
+
|
|
33
|
+
List all available skills from the dotfiles repo.
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
brady skills list
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Prints each skill name fetched from `bharper77/dotfiles` → `.agents/skills/`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### `brady skills add`
|
|
44
|
+
|
|
45
|
+
Interactively select and download one or more skills into `.agents/skills/` relative to your current working directory.
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
brady skills add
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use **space** to toggle skills and **enter** to confirm your selection.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### `brady skills add <name>`
|
|
56
|
+
|
|
57
|
+
Download a specific skill directly without the interactive picker.
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
brady skills add my-skill
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Local Dev Workflow
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
# Install dependencies
|
|
69
|
+
pnpm install
|
|
70
|
+
|
|
71
|
+
# Build
|
|
72
|
+
pnpm run build
|
|
73
|
+
|
|
74
|
+
# Run locally (after build)
|
|
75
|
+
pnpm brady skills list
|
|
76
|
+
pnpm brady init -d my-project
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Releasing
|
|
80
|
+
|
|
81
|
+
This package uses [semantic-release](https://github.com/semantic-release/semantic-release) for fully automated versioning and publishing based on [Conventional Commits](https://www.conventionalcommits.org/).
|
|
82
|
+
|
|
83
|
+
### How it works
|
|
84
|
+
|
|
85
|
+
Merging to `main` triggers the Publish workflow, which:
|
|
86
|
+
|
|
87
|
+
1. Analyzes commits since the last release to determine the semver bump (`fix:` → patch, `feat:` → minor, `BREAKING CHANGE` → major)
|
|
88
|
+
2. Updates `CHANGELOG.md` and bumps the version in `package.json`
|
|
89
|
+
3. Publishes to npm via `pnpm publish`
|
|
90
|
+
4. Commits the updated files back and creates a GitHub release
|
|
91
|
+
|
|
92
|
+
**No manual steps are needed.** Just write commits using Conventional Commit messages:
|
|
93
|
+
|
|
94
|
+
| Commit prefix | Version bump |
|
|
95
|
+
| ---------------------------------------- | ------------ |
|
|
96
|
+
| `fix:` | patch |
|
|
97
|
+
| `feat:` | minor |
|
|
98
|
+
| `feat!:` or `BREAKING CHANGE:` in footer | major |
|
|
99
|
+
|
|
100
|
+
### Your workflow
|
|
101
|
+
|
|
102
|
+
1. **Make changes** using Conventional Commit messages, e.g.:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
git commit -m "feat: add new scaffold template"
|
|
106
|
+
git commit -m "fix: correct output path for init command"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
2. **Push to a branch and open a PR.** The Build workflow runs typecheck + build on every push.
|
|
110
|
+
|
|
111
|
+
3. **Merge to `main`.** semantic-release automatically determines the version, publishes to npm, and creates a GitHub release.
|