takumi-cli 1.2.0 → 1.2.2
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 +84 -84
- package/commands/mcp-config.sh +29 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
1
|
# takumi (匠)
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
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
|
-
|
|
17
|
+
`setup` installs ffmpeg and whisper via Homebrew.
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
### Windows
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
npm install -g takumi-cli
|
|
20
|
-
```
|
|
21
|
+
**Prerequisites:**
|
|
21
22
|
|
|
22
|
-
|
|
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
|
-
|
|
26
|
+
Then open PowerShell:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
npm install -g takumi-cli
|
|
25
30
|
takumi setup
|
|
26
31
|
```
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
`setup` installs ffmpeg via winget, chocolatey, or scoop (whichever is available).
|
|
29
34
|
|
|
30
|
-
###
|
|
31
|
-
|
|
32
|
-
takumi includes an MCP server so AI clients can use all commands as tools.
|
|
35
|
+
### Linux
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
|
-
|
|
38
|
+
npm install -g takumi-cli
|
|
39
|
+
takumi setup
|
|
36
40
|
```
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
`setup` installs ffmpeg and whisper via apt, dnf, or pacman.
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
- **Kiro:** `.kiro/settings/mcp.json`
|
|
44
|
+
## Commands
|
|
42
45
|
|
|
43
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
60
|
+
### Examples
|
|
48
61
|
|
|
49
62
|
```bash
|
|
50
|
-
|
|
51
|
-
takumi
|
|
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
|
-
|
|
66
|
+
# Higher quality conversion, max 720p
|
|
67
|
+
takumi convert ./videos 21 720
|
|
56
68
|
|
|
57
|
-
|
|
69
|
+
# Trim a 75-second clip
|
|
70
|
+
takumi trim video.mp4 00:01:30 00:02:45
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
takumi
|
|
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
|
-
|
|
75
|
+
# Thumbnail at a specific frame
|
|
76
|
+
takumi thumb video.mp4 00:00:15
|
|
67
77
|
|
|
68
|
-
|
|
78
|
+
# Create a GIF from a 5-second clip
|
|
79
|
+
takumi gif video.mp4 00:00:05 00:00:10
|
|
69
80
|
|
|
70
|
-
|
|
81
|
+
# Extract audio only
|
|
82
|
+
takumi strip video.mp4 audio
|
|
71
83
|
|
|
72
|
-
|
|
73
|
-
takumi
|
|
84
|
+
# Check resolution, codec, duration
|
|
85
|
+
takumi info ./videos
|
|
74
86
|
```
|
|
75
87
|
|
|
76
|
-
|
|
88
|
+
## AI Integration (MCP)
|
|
77
89
|
|
|
78
|
-
|
|
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 in plain language.
|
|
79
91
|
|
|
80
92
|
```bash
|
|
81
|
-
takumi
|
|
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
|
-
|
|
96
|
+
This prints the JSON config block for each client. Paste the relevant one into:
|
|
87
97
|
|
|
88
|
-
|
|
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
|
-
|
|
102
|
+
## Update
|
|
91
103
|
|
|
92
104
|
```bash
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Shows duration, resolution, codecs, bitrate, and file size.
|
|
98
|
-
|
|
99
|
-
### Create GIF
|
|
105
|
+
# Homebrew (macOS)
|
|
106
|
+
brew update && brew upgrade takumi
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
takumi gif video.mp4 00:00:05 00:00:10 320 # 320px wide
|
|
108
|
+
# npm (any platform)
|
|
109
|
+
npm update -g takumi-cli
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
|
|
112
|
+
## Troubleshooting
|
|
107
113
|
|
|
108
|
-
|
|
114
|
+
### Windows: `takumi` is not recognized
|
|
109
115
|
|
|
110
|
-
|
|
116
|
+
The npm global bin directory may not be in your PATH. Run this in PowerShell:
|
|
111
117
|
|
|
112
|
-
```
|
|
113
|
-
|
|
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
|
|
118
|
+
```powershell
|
|
119
|
+
npm prefix -g
|
|
117
120
|
```
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
### Convert SRT to VTT
|
|
122
|
+
If the output (e.g. `C:\Users\<you>\AppData\Roaming\npm`) is not in your PATH, add it:
|
|
122
123
|
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
takumi srt2vtt ./videos # all SRTs in folder
|
|
124
|
+
```powershell
|
|
125
|
+
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Users\$env:USERNAME\AppData\Roaming\npm", "User")
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Then close and reopen PowerShell.
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
takumi vtt2srt subtitle.vtt # single file
|
|
132
|
-
takumi vtt2srt ./videos # all VTTs in folder
|
|
133
|
-
```
|
|
130
|
+
### Windows: bash not found
|
|
134
131
|
|
|
135
|
-
|
|
132
|
+
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
133
|
|
|
137
|
-
|
|
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
|
|
134
|
+
### ffmpeg not found after setup
|
|
141
135
|
|
|
142
|
-
|
|
136
|
+
Restart your terminal. If it still doesn't work, check that ffmpeg is installed:
|
|
143
137
|
|
|
144
138
|
```bash
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
ffmpeg -version
|
|
140
|
+
```
|
|
147
141
|
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
On Windows, you can install it manually with:
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
winget install --id Gyan.FFmpeg -e
|
|
150
146
|
```
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT
|
package/commands/mcp-config.sh
CHANGED
|
@@ -11,7 +11,35 @@ cmd_mcp-config() {
|
|
|
11
11
|
return 1
|
|
12
12
|
fi
|
|
13
13
|
|
|
14
|
-
echo "
|
|
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
|
{
|