takumi-cli 1.2.0 → 1.2.3

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/README.md CHANGED
@@ -1,150 +1,159 @@
1
1
  # takumi (匠)
2
2
 
3
- The craftsman's toolkit for shaping video assets.
3
+ A command-line toolkit for processing video assets. Convert, trim, caption, thumbnail, and inspect videos — one command at a time or in batch across folders.
4
+
5
+ Works on macOS, Windows, and Linux.
4
6
 
5
7
  ## Install
6
8
 
7
- ### macOS (Homebrew)
9
+ ### macOS
8
10
 
9
11
  ```bash
10
12
  brew tap kaiyiwong/tap
11
13
  brew install takumi
14
+ takumi setup
12
15
  ```
13
16
 
14
- ### Any platform (npm)
17
+ `setup` installs ffmpeg and whisper via Homebrew.
15
18
 
16
- Requires [Node.js](https://nodejs.org) and [Git](https://git-scm.com) (Git provides bash on Windows).
19
+ ### Windows
17
20
 
18
- ```bash
19
- npm install -g takumi-cli
20
- ```
21
+ **Prerequisites:**
21
22
 
22
- ### Then install dependencies
23
+ 1. Install [Node.js](https://nodejs.org) (LTS recommended)
24
+ 2. Install [Git for Windows](https://git-scm.com/download/win)
23
25
 
24
- ```bash
26
+ Then open PowerShell:
27
+
28
+ ```powershell
29
+ npm install -g takumi-cli
25
30
  takumi setup
26
31
  ```
27
32
 
28
- This installs ffmpeg and whisper. On macOS it uses Homebrew, on Linux it uses your system package manager, and on Windows it uses winget, chocolatey, or scoop.
33
+ `setup` installs ffmpeg via winget, chocolatey, or scoop (whichever is available).
29
34
 
30
- ### MCP Server (Claude Code, Kiro, etc.)
31
-
32
- takumi includes an MCP server so AI clients can use all commands as tools.
35
+ ### Linux
33
36
 
34
37
  ```bash
35
- takumi mcp-config
38
+ npm install -g takumi-cli
39
+ takumi setup
36
40
  ```
37
41
 
38
- This prints the JSON config block. Paste it into your MCP settings file:
42
+ `setup` installs ffmpeg and whisper via apt, dnf, or pacman.
39
43
 
40
- - **Claude Code:** `~/.claude.json` or project `.mcp.json`
41
- - **Kiro:** `.kiro/settings/mcp.json`
44
+ ## Commands
42
45
 
43
- Then just talk naturally — "convert these for FireTV", "generate Japanese captions for this folder".
46
+ | Command | Description |
47
+ |---------|-------------|
48
+ | `takumi convert <path> [crf] [max_height]` | Convert to FireTV-optimized H.264 MP4 |
49
+ | `takumi trim <video> <start> <end>` | Cut a clip between timestamps |
50
+ | `takumi cc <path> [lang] [model] [format]` | Generate captions using Whisper |
51
+ | `takumi thumb <path> [timestamp]` | Extract a poster image (JPG) |
52
+ | `takumi info <path>` | Show video metadata |
53
+ | `takumi gif <video> <start> <end> [width]` | Create animated GIF from a clip |
54
+ | `takumi strip <path> <audio\|video\|both>` | Extract audio/video as separate tracks |
55
+ | `takumi srt2vtt <path>` | Convert SRT subtitles to VTT |
56
+ | `takumi vtt2srt <path>` | Convert VTT subtitles to SRT |
44
57
 
45
- ## Commands
58
+ All commands accept a single file or a folder (processes all videos recursively). Existing outputs are skipped on re-run so it's safe to retry.
46
59
 
47
- ### Generate Captions
60
+ ### Examples
48
61
 
49
62
  ```bash
50
- takumi cc video.mp4 # auto-detect language
51
- takumi cc ./videos ja # Japanese, all videos in folder
52
- takumi cc ./videos en large vtt # English, large model, VTT format
53
- ```
63
+ # Convert all videos in a folder for FireTV
64
+ takumi convert ./videos
54
65
 
55
- Options: `[language]` `[model: tiny|base|small|medium|large]` `[format: srt|vtt]`
66
+ # Higher quality conversion, max 720p
67
+ takumi convert ./videos 21 720
56
68
 
57
- ### Convert to FireTV MP4
69
+ # Trim a 75-second clip
70
+ takumi trim video.mp4 00:01:30 00:02:45
58
71
 
59
- ```bash
60
- takumi convert video.mp4 # single file
61
- takumi convert ./videos # batch folder
62
- takumi convert ./videos 21 # higher quality (CRF 21)
63
- takumi convert ./videos 23 720 # max 720p
64
- ```
72
+ # Generate Japanese captions with the large model
73
+ takumi cc ./videos ja large
65
74
 
66
- Outputs H.264 High Profile MP4 with mod16 dimensions, AAC audio, faststart flag. Auto-detects 16:9 vs 4:3 aspect ratio.
75
+ # Thumbnail at a specific frame
76
+ takumi thumb video.mp4 00:00:15
67
77
 
68
- Options: `[crf: 18-28, default 23]` `[max_height: default 1080]`
78
+ # Create a GIF from a 5-second clip
79
+ takumi gif video.mp4 00:00:05 00:00:10
69
80
 
70
- ### Trim Clip
81
+ # Extract audio only
82
+ takumi strip video.mp4 audio
71
83
 
72
- ```bash
73
- takumi trim video.mp4 00:01:30 00:02:45
84
+ # Check resolution, codec, duration
85
+ takumi info ./videos
74
86
  ```
75
87
 
76
- Cuts a segment between two timestamps. Uses stream copy (no re-encoding) so it's fast.
88
+ ## AI Integration (MCP)
77
89
 
78
- ### Extract Thumbnail
90
+ takumi includes an MCP server so AI clients like Claude Code and Kiro can use all commands as tools. No syntax to remember, just describe what you want.
79
91
 
80
92
  ```bash
81
- takumi thumb video.mp4 # frame at 00:00:01
82
- takumi thumb video.mp4 00:00:15 # frame at specific time
83
- takumi thumb ./videos # all videos in folder
93
+ takumi mcp-config
84
94
  ```
85
95
 
86
- Extracts a high-quality JPG poster image at the video's native resolution.
96
+ This prints the JSON config block for each client. Paste the relevant one into:
87
97
 
88
- Options: `[timestamp: default 00:00:01]`
98
+ - **VS Code:** `.vscode/mcp.json` (uses `"servers"`)
99
+ - **Claude Code:** `~/.claude.json` or project `.mcp.json` (uses `"mcpServers"`)
100
+ - **Kiro:** `.kiro/settings/mcp.json` (uses `"mcpServers"`)
89
101
 
90
- ### Video Info
102
+ Once configured, just ask in natural language:
91
103
 
92
- ```bash
93
- takumi info video.mp4 # single file
94
- takumi info ./videos # all videos in folder
95
- ```
104
+ - "convert all the videos in ~/projects/campaign for FireTV"
105
+ - "what's the resolution and duration of this video?"
106
+ - "generate Japanese captions for the videos in this folder"
107
+ - "trim the intro, keep only 00:01:30 to 00:04:00"
108
+ - "extract the audio from meeting.mp4"
109
+ - "make a gif from the first 5 seconds of demo.mp4"
96
110
 
97
- Shows duration, resolution, codecs, bitrate, and file size.
98
-
99
- ### Create GIF
111
+ ## Update
100
112
 
101
113
  ```bash
102
- takumi gif video.mp4 00:00:05 00:00:10 # 480px wide (default)
103
- takumi gif video.mp4 00:00:05 00:00:10 320 # 320px wide
114
+ # Homebrew (macOS)
115
+ brew update && brew upgrade takumi
116
+
117
+ # npm (any platform)
118
+ npm update -g takumi-cli
104
119
  ```
105
120
 
106
- Creates an optimized animated GIF from a clip. Uses palette generation for better colors.
121
+ ## Troubleshooting
107
122
 
108
- Options: `[width: default 480]`
123
+ ### Windows: `takumi` is not recognized
109
124
 
110
- ### Strip Audio/Video
125
+ The npm global bin directory may not be in your PATH. Run this in PowerShell:
111
126
 
112
- ```bash
113
- takumi strip video.mp4 audio # extract audio only (.m4a)
114
- takumi strip video.mp4 video # extract video only, no audio
115
- takumi strip video.mp4 both # extract both as separate files
116
- takumi strip ./videos both # batch folder
127
+ ```powershell
128
+ npm prefix -g
117
129
  ```
118
130
 
119
- Uses stream copy (no re-encoding).
120
-
121
- ### Convert SRT to VTT
131
+ If the output (e.g. `C:\Users\<you>\AppData\Roaming\npm`) is not in your PATH, add it:
122
132
 
123
- ```bash
124
- takumi srt2vtt subtitle.srt # single file
125
- takumi srt2vtt ./videos # all SRTs in folder
133
+ ```powershell
134
+ [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Users\$env:USERNAME\AppData\Roaming\npm", "User")
126
135
  ```
127
136
 
128
- ### Convert VTT to SRT
137
+ Then close and reopen PowerShell.
129
138
 
130
- ```bash
131
- takumi vtt2srt subtitle.vtt # single file
132
- takumi vtt2srt ./videos # all VTTs in folder
133
- ```
139
+ ### Windows: bash not found
134
140
 
135
- ## Notes
141
+ takumi needs bash to run. Git for Windows includes it. Make sure [Git for Windows](https://git-scm.com/download/win) is installed — the default installation options are fine.
136
142
 
137
- - All commands support single files or folders (recursive)
138
- - Existing outputs are skipped on re-run (safe to retry)
139
- - Converted videos get a `_firetv` suffix
140
- - Captions are saved next to the source video
143
+ ### ffmpeg not found after setup
141
144
 
142
- ## Update
145
+ Restart your terminal. If it still doesn't work, check that ffmpeg is installed:
143
146
 
144
147
  ```bash
145
- # Homebrew
146
- brew update && brew upgrade takumi
148
+ ffmpeg -version
149
+ ```
147
150
 
148
- # npm
149
- npm update -g takumi-cli
151
+ On Windows, you can install it manually with:
152
+
153
+ ```powershell
154
+ winget install --id Gyan.FFmpeg -e
150
155
  ```
156
+
157
+ ## License
158
+
159
+ MIT
@@ -11,7 +11,35 @@ cmd_mcp-config() {
11
11
  return 1
12
12
  fi
13
13
 
14
- echo "Add this to your MCP settings (Claude Code, Kiro, etc.):"
14
+ echo "── VS Code (.vscode/mcp.json) ──"
15
+ echo ""
16
+ cat <<EOF
17
+ {
18
+ "servers": {
19
+ "takumi": {
20
+ "command": "node",
21
+ "args": ["${MCP_SERVER}"]
22
+ }
23
+ }
24
+ }
25
+ EOF
26
+
27
+ echo ""
28
+ echo "── Claude Code (~/.claude.json or .mcp.json) ──"
29
+ echo ""
30
+ cat <<EOF
31
+ {
32
+ "mcpServers": {
33
+ "takumi": {
34
+ "command": "node",
35
+ "args": ["${MCP_SERVER}"]
36
+ }
37
+ }
38
+ }
39
+ EOF
40
+
41
+ echo ""
42
+ echo "── Kiro (.kiro/settings/mcp.json) ──"
15
43
  echo ""
16
44
  cat <<EOF
17
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "takumi-cli",
3
- "version": "1.2.0",
3
+ "version": "1.2.3",
4
4
  "description": "The craftsman's toolkit for shaping video assets",
5
5
  "bin": {
6
6
  "takumi": "bin/takumi.js"