@towles/tool 0.0.18 → 0.0.41
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/LICENSE +21 -0
- package/LICENSE.md +9 -10
- package/README.md +121 -78
- package/bin/run.ts +5 -0
- package/package.json +63 -53
- package/patches/prompts.patch +34 -0
- package/src/commands/base.ts +42 -0
- package/src/commands/config.test.ts +15 -0
- package/src/commands/config.ts +43 -0
- package/src/commands/doctor.ts +133 -0
- package/src/commands/gh/branch-clean.ts +110 -0
- package/src/commands/gh/branch.test.ts +124 -0
- package/src/commands/gh/branch.ts +132 -0
- package/src/commands/gh/pr.ts +168 -0
- package/src/commands/index.ts +55 -0
- package/src/commands/install.ts +148 -0
- package/src/commands/journal/daily-notes.ts +66 -0
- package/src/commands/journal/meeting.ts +83 -0
- package/src/commands/journal/note.ts +83 -0
- package/src/commands/journal/utils.ts +399 -0
- package/src/commands/observe/graph.test.ts +89 -0
- package/src/commands/observe/graph.ts +1640 -0
- package/src/commands/observe/report.ts +166 -0
- package/src/commands/observe/session.ts +385 -0
- package/src/commands/observe/setup.ts +180 -0
- package/src/commands/observe/status.ts +146 -0
- package/src/commands/ralph/lib/execution.ts +302 -0
- package/src/commands/ralph/lib/formatter.ts +298 -0
- package/src/commands/ralph/lib/index.ts +4 -0
- package/src/commands/ralph/lib/marker.ts +108 -0
- package/src/commands/ralph/lib/state.ts +191 -0
- package/src/commands/ralph/marker/create.ts +23 -0
- package/src/commands/ralph/plan.ts +73 -0
- package/src/commands/ralph/progress.ts +44 -0
- package/src/commands/ralph/ralph.test.ts +673 -0
- package/src/commands/ralph/run.ts +408 -0
- package/src/commands/ralph/task/add.ts +105 -0
- package/src/commands/ralph/task/done.ts +73 -0
- package/src/commands/ralph/task/list.test.ts +48 -0
- package/src/commands/ralph/task/list.ts +110 -0
- package/src/commands/ralph/task/remove.ts +62 -0
- package/src/config/context.ts +7 -0
- package/src/config/settings.ts +155 -0
- package/src/constants.ts +3 -0
- package/src/types/journal.ts +16 -0
- package/src/utils/anthropic/types.ts +158 -0
- package/src/utils/date-utils.test.ts +96 -0
- package/src/utils/date-utils.ts +54 -0
- package/src/utils/exec.ts +8 -0
- package/src/utils/git/gh-cli-wrapper.test.ts +14 -0
- package/src/utils/git/gh-cli-wrapper.ts +54 -0
- package/src/utils/git/git-wrapper.test.ts +26 -0
- package/src/utils/git/git-wrapper.ts +15 -0
- package/src/utils/git/git.ts +25 -0
- package/src/utils/render.test.ts +71 -0
- package/src/utils/render.ts +34 -0
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +0 -794
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chris Towles
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/LICENSE.md
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# Proprietary License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 Chris Towles. All rights reserved.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
5
|
+
This software and associated documentation files (the "Software") are proprietary
|
|
6
|
+
and confidential. Unauthorized copying, modification, distribution, or use of
|
|
7
|
+
this Software, via any medium, is strictly prohibited.
|
|
11
8
|
|
|
12
|
-
The
|
|
13
|
-
|
|
9
|
+
The Software is provided for the sole use of authorized individuals or entities
|
|
10
|
+
who have been granted explicit written permission by the copyright holder.
|
|
14
11
|
|
|
15
12
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
13
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
@@ -19,3 +16,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
16
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
17
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
18
|
SOFTWARE.
|
|
19
|
+
|
|
20
|
+
For licensing inquiries, contact: Chris.Towles.Dev@gmail.com
|
package/README.md
CHANGED
|
@@ -1,116 +1,159 @@
|
|
|
1
1
|
# Towles Tool
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
-
[![bundle][bundle-src]][bundle-href]
|
|
6
|
-
[![JSDocs][jsdocs-src]][jsdocs-href]
|
|
7
|
-
[![License][license-src]][license-href]
|
|
3
|
+
Collection of quality-of-life tools and Claude Code plugins for daily development workflows.
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
## Overview
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
**CLI tool** (`tt`) - Distributed as a compiled Bun executable for daily development tasks.
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
**Claude Code Plugin Marketplace** - Hosts Claude Code plugins for personal use.
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
- **Purpose**: Weekly files with daily sections for ongoing work and notes
|
|
17
|
-
- **File structure**: `YYYY/daily-notes/YYYY-MM-DD-week-log.md` (Monday's date)
|
|
18
|
-
- **Template**: Includes sections for Monday through Friday with date headers
|
|
19
|
-
- **Use case**: Regular daily journaling, work logs, scratch pad for notes
|
|
11
|
+
The project evolved from a private toolbox of personal scripts to a compiled Bun executable and Claude Code plugin marketplace.
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
- **Purpose**: Structured meeting notes with agenda and action items
|
|
23
|
-
- **File structure**: `YYYY/meetings/YYYY-MM-DD-HHMM-meeting-[title].md`
|
|
24
|
-
- **Template**: Includes Date, Time, Attendees, Agenda, Notes, Action Items, and Follow-up sections
|
|
25
|
-
- **Use case**: Meeting preparation, note-taking, and action item tracking
|
|
13
|
+
## Installation
|
|
26
14
|
|
|
27
|
-
###
|
|
28
|
-
- **Purpose**: General-purpose notes with structured sections
|
|
29
|
-
- **File structure**: `YYYY/notes/YYYY-MM-DD-HHMM-note-[title].md`
|
|
30
|
-
- **Template**: Includes Summary, Details, and References sections
|
|
31
|
-
- **Use case**: Research notes, documentation, general information capture
|
|
15
|
+
### CLI Tool
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
- `journal` or `journal daily-notes` - Create/open current week's daily notes
|
|
35
|
-
- `journal meeting [title]` - Create a new meeting file with optional title
|
|
36
|
-
- `journal note [title]` - Create a new note file with optional title
|
|
17
|
+
Download the pre-built executable for your platform from [Releases](https://github.com/ChrisTowles/towles-tool/releases), or build from source:
|
|
37
18
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
```bash
|
|
20
|
+
# Clone and build
|
|
21
|
+
git clone https://github.com/ChrisTowles/towles-tool.git
|
|
22
|
+
cd towles-tool
|
|
23
|
+
bun install
|
|
24
|
+
bun run build
|
|
25
|
+
|
|
26
|
+
# The executable is at dist/tt
|
|
27
|
+
# Move it somewhere in your PATH
|
|
28
|
+
mv dist/tt ~/.local/bin/tt
|
|
29
|
+
```
|
|
41
30
|
|
|
42
|
-
|
|
31
|
+
### Claude Code Plugins
|
|
32
|
+
|
|
33
|
+
Install plugins from this marketplace:
|
|
43
34
|
|
|
44
35
|
```bash
|
|
45
|
-
|
|
36
|
+
/plugins marketplace add ChrisTowles/towles-tool
|
|
37
|
+
/plugin install tt@ChrisTowles/towles-tool
|
|
38
|
+
```
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
I do find myself editing `~/.claude/settings.json` a lot to directly modify settings around plugins.
|
|
41
|
+
|
|
42
|
+
### Shell Completions
|
|
43
|
+
|
|
44
|
+
Generate shell completions for tab completion support:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Bash - add to ~/.bashrc
|
|
48
|
+
tt completion >> ~/.bashrc
|
|
49
49
|
|
|
50
|
-
#
|
|
51
|
-
|
|
50
|
+
# Zsh - add to ~/.zshrc
|
|
51
|
+
tt completion >> ~/.zshrc
|
|
52
|
+
|
|
53
|
+
# Fish
|
|
54
|
+
tt completion > ~/.config/fish/completions/tt.fish
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
##
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
### Setup
|
|
55
60
|
|
|
56
61
|
```bash
|
|
57
|
-
|
|
62
|
+
# Clone the repository
|
|
63
|
+
git clone https://github.com/ChrisTowles/towles-tool.git
|
|
64
|
+
cd towles-tool
|
|
65
|
+
bun install
|
|
58
66
|
```
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
### Commands
|
|
61
69
|
|
|
62
|
-
try running with pnpm
|
|
63
70
|
```bash
|
|
64
|
-
|
|
71
|
+
bun run start # Run the CLI directly
|
|
72
|
+
bun run build # Build executable for current platform
|
|
73
|
+
bun run build:all # Build for all platforms (Linux, macOS, Windows)
|
|
74
|
+
bun run test # Run tests
|
|
75
|
+
bun run lint # Run linter
|
|
76
|
+
bun run typecheck # Type check
|
|
65
77
|
```
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## packages to consider
|
|
70
|
-
- [@anthropic-ai/claude-code](https://github.com/anthropic-ai/claude-code) - A library for interacting with the Claude code
|
|
71
|
-
- [zod](https://github.com/colinhacks/zod) - TypeScript-first schema validation
|
|
72
|
-
- [Consola](https://github.com/unjs/consola) console wrapper and colors
|
|
73
|
-
- ~~[c12](https://github.com/unjs/c12) configuration loader and utilities~~
|
|
74
|
-
- referted stayed to json config
|
|
75
|
-
- [rolldown-vite](https://voidzero.dev/posts/announcing-rolldown-vite) - A Vite plugin for rolling down your code
|
|
76
|
-
- ~~[zx](https://github.com/google/zx) google created library to write shell scripts in a more powerful and expressive way via the Anthropic API.~~
|
|
77
|
-
- [prompts](https://github.com/terkelg/prompts) - A library for creating beautiful command-line prompts, with fuzzy search and other features.
|
|
78
|
-
- had to patch it so `esc` cancels the selection with [pnpm-patch-i](https://github.com/antfu/pnpm-patch-i)
|
|
79
|
-
- [yargs](https://github.com/yargs/yargs) - A modern, feature-rich command-line argument parser with enhanced error handling, TypeScript support, and flexible command configuration.
|
|
80
|
-
- ~~[ink](https://github.com/vadimdemedes/ink) - React for interactive command-line apps~~
|
|
81
|
-
- wanted hotkey support and more complex UI but this was overkill for this project.
|
|
82
|
-
- [publint](https://publint.dev/)
|
|
83
|
-
- [e18e.dev](https://e18e.dev/guide/resources.html)
|
|
84
|
-
|
|
85
|
-
## Document verbose and debug options
|
|
79
|
+
### Plugin Validation
|
|
86
80
|
|
|
87
81
|
```bash
|
|
88
|
-
|
|
82
|
+
claude plugin validate . # Validate Claude Code plugins before publishing
|
|
89
83
|
```
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
**Plugin Marketplace**: `.claude-plugin/marketplace.json`
|
|
92
86
|
|
|
93
|
-
|
|
87
|
+
- Defines available plugins for installation
|
|
88
|
+
|
|
89
|
+
### Releasing
|
|
90
|
+
|
|
91
|
+
See [docs/releasing.md](./docs/releasing.md) for full details.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
gh workflow run release.yml -f bump_type=patch # or minor/major
|
|
95
|
+
gh run watch # monitor progress
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Reminders for me
|
|
99
|
+
|
|
100
|
+
- Use plan mode!
|
|
101
|
+
- in plan mode tell claude your problems.
|
|
102
|
+
- in edit mode tell claude its problems.
|
|
103
|
+
- use `/context` to see what is using context and if you need to trim anything down.
|
|
104
|
+
- Only add context Claude doesn't already have but needs
|
|
105
|
+
- Always write in third person for prompts
|
|
106
|
+
- use a tool to write your prompts and evaluate them.
|
|
107
|
+
- These models are smart. Less is more. don't be too verbose
|
|
108
|
+
- https://console.anthropic.com/workbench/
|
|
109
|
+
- read source code from primary sources like:
|
|
110
|
+
- [anthropic repos](https://github.com/anthropics)
|
|
111
|
+
- [Skills best practices](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices#core-principles)
|
|
112
|
+
- gerund form (verb + -ing) for skill names
|
|
113
|
+
- [claude cookbook skills section](https://github.com/anthropics/claude-cookbooks/tree/main/skills)
|
|
114
|
+
- https://github.com/anthropics/skills
|
|
115
|
+
- installed as a plugin, has examples and skill-creator
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
/plugin marketplace add anthropics/skills
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Roadmap
|
|
122
|
+
|
|
123
|
+
### Planned Features
|
|
124
|
+
|
|
125
|
+
**Journal Type System**:
|
|
94
126
|
|
|
95
|
-
|
|
127
|
+
- [ ] daily-notes
|
|
128
|
+
- [ ] meeting
|
|
129
|
+
- [ ] note
|
|
130
|
+
- [ ] task (todo)
|
|
131
|
+
|
|
132
|
+
**Git Tools**:
|
|
133
|
+
|
|
134
|
+
- [ ] commit-message-generator
|
|
135
|
+
- [ ] pull-request-generator
|
|
136
|
+
- [ ] issue-generator
|
|
137
|
+
- [ ] pull-request-reviewer
|
|
138
|
+
- [ ] branch-from-issue
|
|
139
|
+
|
|
140
|
+
## Resources
|
|
141
|
+
|
|
142
|
+
### Claude Code Plugin Development
|
|
143
|
+
|
|
144
|
+
- [Claude Code Plugins Announcement](https://www.anthropic.com/news/claude-code-plugins)
|
|
145
|
+
- [Official Claude Code Plugins](https://github.com/anthropics/claude-code/tree/main/plugins)
|
|
146
|
+
- [Skills Guide](https://docs.claude.com/en/api/skills-guide)
|
|
147
|
+
- [Best Practices](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices)
|
|
148
|
+
|
|
149
|
+
### Project Documentation
|
|
150
|
+
|
|
151
|
+
- [Node Package](./docs/node-package.md) - How the repo worked when it was a node package
|
|
96
152
|
|
|
97
153
|
## History
|
|
98
154
|
|
|
99
|
-
|
|
155
|
+
This project started as a collection of personal scripts and utilities built up over time in a private toolbox. It was initially published as an npm package, but has since evolved to be distributed as a compiled Bun executable. With the release of Claude Code Skills and plugins, the project also serves as a Claude Code plugin marketplace.
|
|
100
156
|
|
|
101
157
|
## License
|
|
102
158
|
|
|
103
159
|
[MIT](./LICENSE) License © [Chris Towles](https://github.com/ChrisTowles)
|
|
104
|
-
|
|
105
|
-
<!-- Badges -->
|
|
106
|
-
|
|
107
|
-
[npm-version-src]: https://img.shields.io/npm/v/@towles/tool?style=flat&colorA=080f12&colorB=1fa669
|
|
108
|
-
[npm-version-href]: https://npmjs.com/package/@towles/tool
|
|
109
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@towles/tool?style=flat&colorA=080f12&colorB=1fa669
|
|
110
|
-
[npm-downloads-href]: https://npmjs.com/package/@towles/tool
|
|
111
|
-
[bundle-src]: https://img.shields.io/bundlephobia/minzip/@towles/tool?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
|
112
|
-
[bundle-href]: https://bundlephobia.com/result?p=@towles/tool
|
|
113
|
-
[license-src]: https://img.shields.io/github/license/ChrisTowles/towles-tool.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
114
|
-
[license-href]: https://github.com/ChrisTowles/towles-tool/blob/main/LICENSE.md
|
|
115
|
-
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
|
116
|
-
[jsdocs-href]: https://www.jsdocs.io/package/@towles/tool
|
package/bin/run.ts
ADDED
package/package.json
CHANGED
|
@@ -1,91 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towles/tool",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.0.18",
|
|
3
|
+
"version": "0.0.41",
|
|
5
4
|
"description": "One off quality of life scripts that I use on a daily basis.",
|
|
6
|
-
"author": "Chris Towles <Chris.Towles.Dev@gmail.com>",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"funding": {
|
|
9
|
-
"url": "https://github.com/sponsors/ChrisTowles"
|
|
10
|
-
},
|
|
11
5
|
"homepage": "https://github.com/ChrisTowles/towles-tool#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/ChrisTowles/towles-tool/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "Chris Towles <Chris.Towles.Dev@gmail.com>",
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
14
13
|
"url": "git+https://github.com/ChrisTowles/towles-tool.git"
|
|
15
14
|
},
|
|
16
|
-
"
|
|
17
|
-
"url": "https://github.com/ChrisTowles
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"sideEffects": false,
|
|
21
|
-
"exports": {
|
|
22
|
-
".": "./dist/index.mjs",
|
|
23
|
-
"./package.json": "./package.json"
|
|
15
|
+
"funding": {
|
|
16
|
+
"url": "https://github.com/sponsors/ChrisTowles"
|
|
24
17
|
},
|
|
25
|
-
"main": "./dist/index.mjs",
|
|
26
|
-
"module": "./dist/index.mjs",
|
|
27
|
-
"types": "./dist/index.d.mts",
|
|
28
18
|
"bin": {
|
|
29
|
-
"towles-tool": "./
|
|
30
|
-
"tt": "./
|
|
19
|
+
"towles-tool": "./bin/run.ts",
|
|
20
|
+
"tt": "./bin/run.ts"
|
|
31
21
|
},
|
|
32
22
|
"files": [
|
|
33
|
-
"
|
|
23
|
+
"bin",
|
|
24
|
+
"patches",
|
|
25
|
+
"src"
|
|
34
26
|
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"version:sync": "pnpm tsx scripts/sync-versions.ts",
|
|
33
|
+
"prepublishOnly": "pnpm run version:sync",
|
|
34
|
+
"start": "tsx bin/run.ts",
|
|
35
|
+
"format": "oxfmt --write .",
|
|
36
|
+
"format:check": "oxfmt --check .",
|
|
37
|
+
"lint": "oxlint",
|
|
38
|
+
"lint:fix": "oxlint --fix",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "CI=DisableCallingClaude vitest watch",
|
|
41
|
+
"typecheck": "tsgo --noEmit --incremental",
|
|
42
|
+
"prepare": "simple-git-hooks"
|
|
43
|
+
},
|
|
35
44
|
"dependencies": {
|
|
36
|
-
"@anthropic-ai/claude-code": "^1.
|
|
45
|
+
"@anthropic-ai/claude-code": "^2.1.4",
|
|
37
46
|
"@anthropic-ai/sdk": "^0.56.0",
|
|
38
|
-
"@
|
|
39
|
-
"comment-json": "^4.2.5",
|
|
47
|
+
"@oclif/core": "^4.3.2",
|
|
40
48
|
"consola": "^3.4.2",
|
|
49
|
+
"d3-hierarchy": "^3.1.2",
|
|
41
50
|
"fzf": "^0.5.2",
|
|
42
51
|
"luxon": "^3.7.1",
|
|
43
52
|
"neverthrow": "^8.2.0",
|
|
53
|
+
"picocolors": "^1.1.1",
|
|
44
54
|
"prompts": "^2.4.2",
|
|
45
55
|
"strip-ansi": "^7.1.0",
|
|
46
56
|
"tinyexec": "^0.3.2",
|
|
47
|
-
"yargs": "^17.7.2",
|
|
48
57
|
"zod": "^4.0.5"
|
|
49
58
|
},
|
|
50
59
|
"devDependencies": {
|
|
51
|
-
"@
|
|
60
|
+
"@oclif/test": "^4.1.10",
|
|
61
|
+
"@types/d3-hierarchy": "^3.1.7",
|
|
52
62
|
"@types/luxon": "^3.6.2",
|
|
53
63
|
"@types/node": "^22.16.3",
|
|
54
64
|
"@types/prompts": "^2.4.9",
|
|
55
|
-
"@
|
|
56
|
-
"bumpp": "^10.
|
|
65
|
+
"@typescript/native-preview": "^7.0.0-dev.20260111.1",
|
|
66
|
+
"bumpp": "^10.4.0",
|
|
57
67
|
"lint-staged": "^15.5.2",
|
|
68
|
+
"oxfmt": "^0.24.0",
|
|
58
69
|
"oxlint": "^1.7.0",
|
|
59
70
|
"simple-git-hooks": "^2.13.0",
|
|
60
|
-
"tsx": "^4.
|
|
71
|
+
"tsx": "^4.19.4",
|
|
61
72
|
"typescript": "^5.8.3",
|
|
62
|
-
"
|
|
63
|
-
"vite": "^6.3.5",
|
|
64
|
-
"vitest": "^3.2.4",
|
|
65
|
-
"vitest-package-exports": "^0.1.1",
|
|
66
|
-
"yaml": "^2.8.0"
|
|
73
|
+
"vitest": "^4.0.17"
|
|
67
74
|
},
|
|
68
75
|
"simple-git-hooks": {
|
|
69
|
-
"pre-commit": "pnpm
|
|
76
|
+
"pre-commit": "pnpm exec lint-staged -q && claude plugin validate ."
|
|
70
77
|
},
|
|
71
78
|
"lint-staged": {
|
|
72
|
-
"
|
|
79
|
+
"*.{js,ts,jsx,tsx,json,md}": "oxfmt --write",
|
|
80
|
+
"*": "oxlint --quiet --fix"
|
|
73
81
|
},
|
|
74
|
-
"
|
|
75
|
-
"
|
|
82
|
+
"oclif": {
|
|
83
|
+
"bin": "tt",
|
|
84
|
+
"commands": {
|
|
85
|
+
"identifier": "default",
|
|
86
|
+
"strategy": "explicit",
|
|
87
|
+
"target": "./src/commands/index.ts"
|
|
88
|
+
},
|
|
89
|
+
"dirname": "towles-tool",
|
|
90
|
+
"topicSeparator": " "
|
|
76
91
|
},
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"test": "vitest --run",
|
|
88
|
-
"test:watch": "CI=DisableCallingClaude vitest --watch",
|
|
89
|
-
"typecheck": "tsc --noEmit"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
+
"packageManager": "pnpm@10.27.0",
|
|
93
|
+
"pnpm": {
|
|
94
|
+
"patchedDependencies": {
|
|
95
|
+
"prompts@2.4.2": "patches/prompts.patch"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"trustedDependencies": [
|
|
99
|
+
"@anthropic-ai/claude-code"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# prompts patch
|
|
2
|
+
#
|
|
3
|
+
# Used by: src/commands/gh/branch.ts (autocomplete with fzf fuzzy filtering)
|
|
4
|
+
#
|
|
5
|
+
# Fix: On exit (Ctrl+C/Ctrl+D), reject the promise instead of resolving.
|
|
6
|
+
# Without this, exiting a prompt resolves with undefined and code continues
|
|
7
|
+
# as if user submitted empty input. This lets us catch cancellation properly.
|
|
8
|
+
|
|
9
|
+
diff --git a/dist/prompts.js b/dist/prompts.js
|
|
10
|
+
index 31f2648a7d215d61aff736424a6f2d66d07e3273..2b8a0ac36fd22ed17f6096ce4f52a4db95ba2633 100644
|
|
11
|
+
--- a/dist/prompts.js
|
|
12
|
+
+++ b/dist/prompts.js
|
|
13
|
+
@@ -14,7 +14,7 @@ function toPrompt(type, args, opts = {}) {
|
|
14
|
+
const onExit = opts.onExit || noop;
|
|
15
|
+
p.on('state', args.onState || noop);
|
|
16
|
+
p.on('submit', x => res(onSubmit(x)));
|
|
17
|
+
- p.on('exit', x => res(onExit(x)));
|
|
18
|
+
+ p.on('exit', x => rej(onExit(x)));
|
|
19
|
+
p.on('abort', x => rej(onAbort(x)));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
diff --git a/lib/prompts.js b/lib/prompts.js
|
|
23
|
+
index 9f625564601da8f79040698de197a6ff2fec3859..e08923fc9f66ab0700788a62455da89ad23c5f35 100644
|
|
24
|
+
--- a/lib/prompts.js
|
|
25
|
+
+++ b/lib/prompts.js
|
|
26
|
+
@@ -11,7 +11,7 @@ function toPrompt(type, args, opts={}) {
|
|
27
|
+
const onExit = opts.onExit || noop;
|
|
28
|
+
p.on('state', args.onState || noop);
|
|
29
|
+
p.on('submit', x => res(onSubmit(x)));
|
|
30
|
+
- p.on('exit', x => res(onExit(x)));
|
|
31
|
+
+ p.on('exit', x => rej(onExit(x)));
|
|
32
|
+
p.on('abort', x => rej(onAbort(x)));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command, Flags } from "@oclif/core";
|
|
2
|
+
import { LoadedSettings, loadSettings } from "../config/settings.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base command that all towles-tool commands extend.
|
|
6
|
+
* Provides shared functionality like settings loading and debug flag.
|
|
7
|
+
*/
|
|
8
|
+
export abstract class BaseCommand extends Command {
|
|
9
|
+
static baseFlags = {
|
|
10
|
+
debug: Flags.boolean({
|
|
11
|
+
char: "d",
|
|
12
|
+
description: "Enable debug output",
|
|
13
|
+
default: false,
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
protected settings!: LoadedSettings;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Called before run(). Loads user settings.
|
|
21
|
+
*/
|
|
22
|
+
async init(): Promise<void> {
|
|
23
|
+
await super.init();
|
|
24
|
+
this.settings = await loadSettings();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Helper to log debug messages when --debug flag is set.
|
|
29
|
+
*/
|
|
30
|
+
protected logDebug(message: string, ...args: unknown[]): void {
|
|
31
|
+
// Access flags via parse() - oclif guarantees flags exist after init()
|
|
32
|
+
void (this.parse as () => Promise<{ flags: { debug?: boolean } }>)()
|
|
33
|
+
.then((parsed) => {
|
|
34
|
+
if (parsed.flags?.debug) {
|
|
35
|
+
this.log(`[DEBUG] ${message}`, ...args);
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
.catch(() => {
|
|
39
|
+
/* ignore parse errors in debug logging */
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for oclif config command
|
|
3
|
+
* Note: consola outputs to stderr with different log levels
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { runCommand } from "@oclif/test";
|
|
7
|
+
|
|
8
|
+
describe("config command", () => {
|
|
9
|
+
it("runs config and outputs settings info", async () => {
|
|
10
|
+
const { stderr } = await runCommand(["config"]);
|
|
11
|
+
// consola.warn outputs captured in stderr
|
|
12
|
+
expect(stderr).toContain("User Config");
|
|
13
|
+
expect(stderr).toContain("Working Directory");
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import consola from "consola";
|
|
2
|
+
import { BaseCommand } from "./base.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Display current configuration settings
|
|
6
|
+
*/
|
|
7
|
+
export default class Config extends BaseCommand {
|
|
8
|
+
static override description = "Display current configuration settings";
|
|
9
|
+
|
|
10
|
+
static override examples = ["<%= config.bin %> <%= command.id %>", "<%= config.bin %> cfg"];
|
|
11
|
+
|
|
12
|
+
async run(): Promise<void> {
|
|
13
|
+
await this.parse(Config);
|
|
14
|
+
|
|
15
|
+
consola.info("Configuration");
|
|
16
|
+
consola.log("");
|
|
17
|
+
|
|
18
|
+
consola.info(`Settings File: ${this.settings.settingsFile.path}`);
|
|
19
|
+
consola.log("");
|
|
20
|
+
|
|
21
|
+
consola.warn("User Config:");
|
|
22
|
+
consola.log(
|
|
23
|
+
` Daily Path Template: ${this.settings.settingsFile.settings.journalSettings.dailyPathTemplate}`,
|
|
24
|
+
);
|
|
25
|
+
consola.log(
|
|
26
|
+
` Meeting Path Template: ${this.settings.settingsFile.settings.journalSettings.meetingPathTemplate}`,
|
|
27
|
+
);
|
|
28
|
+
consola.log(
|
|
29
|
+
` Note Path Template: ${this.settings.settingsFile.settings.journalSettings.notePathTemplate}`,
|
|
30
|
+
);
|
|
31
|
+
consola.log(` Editor: ${this.settings.settingsFile.settings.preferredEditor}`);
|
|
32
|
+
consola.log("");
|
|
33
|
+
|
|
34
|
+
consola.warn("Working Directory:");
|
|
35
|
+
consola.log(` ${process.cwd()}`);
|
|
36
|
+
consola.log("");
|
|
37
|
+
|
|
38
|
+
consola.info("Shell Completions:");
|
|
39
|
+
consola.log(" Run `tt completion` to generate shell completions");
|
|
40
|
+
consola.log(" Bash/Zsh: tt completion >> ~/.bashrc (or ~/.zshrc)");
|
|
41
|
+
consola.log(" Fish: tt completion > ~/.config/fish/completions/tt.fish");
|
|
42
|
+
}
|
|
43
|
+
}
|