@automigrate/cli 0.1.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/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/chunk-ISRV2HNG.js +10113 -0
- package/dist/chunk-ISRV2HNG.js.map +1 -0
- package/dist/index.js +3231 -0
- package/dist/index.js.map +1 -0
- package/dist/node-K2FLC74M.js +871 -0
- package/dist/node-K2FLC74M.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AutoMigrate
|
|
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/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @automigrate/cli
|
|
2
|
+
|
|
3
|
+
Autonomous codebase migrations from your terminal, powered by Claude. Plans, transforms, and verifies a migration in three passes — writing results to `./migrated/` and never touching your originals.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# one-off via npx (scoped package; the installed binary is `automigrate`)
|
|
7
|
+
npx @automigrate/cli run --target javascript-to-typescript
|
|
8
|
+
|
|
9
|
+
# or install globally and use the `automigrate` command
|
|
10
|
+
npm i -g @automigrate/cli
|
|
11
|
+
automigrate run --target javascript-to-typescript
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
Run inside the project you want to migrate.
|
|
17
|
+
|
|
18
|
+
| Command | Description |
|
|
19
|
+
| ---------------------------------- | ------------------------------------------------------------------------ |
|
|
20
|
+
| `automigrate init` | Detect the stack in the current directory and suggest migration targets. |
|
|
21
|
+
| `automigrate run` | Run a full migration: plan → execute → verify. |
|
|
22
|
+
| `automigrate rollback` | Restore originals from the pre‑migration backup and remove `/migrated`. |
|
|
23
|
+
| `automigrate status` | Show the last 5 migration jobs. |
|
|
24
|
+
| `automigrate config set-key <key>` | Save your Anthropic API key to `~/.automigrate/config.json` (chmod 600). |
|
|
25
|
+
|
|
26
|
+
## Options
|
|
27
|
+
|
|
28
|
+
| Flag | Command | Description |
|
|
29
|
+
| -------------------- | ---------- | ------------------------------------------------------------------- |
|
|
30
|
+
| `--target <from-to>` | `run` | Migration target, e.g. `javascript-to-typescript`. |
|
|
31
|
+
| `--dry-run` | `run` | Plan only — print the plan and exit without transforming any files. |
|
|
32
|
+
| `--resume` | `run` | Resume the last failed migration from its checkpoint. |
|
|
33
|
+
| `--job <id>` | `rollback` | Job id to roll back (defaults to the most recent). |
|
|
34
|
+
| `--version` | (root) | Print the CLI version. |
|
|
35
|
+
| `--help` | (any) | Show help for the command. |
|
|
36
|
+
|
|
37
|
+
> Output is written to `./migrated/` and a git‑apply‑compatible `output.patch` is produced. Source files are never modified. Resumable state lives in `~/.automigrate/` (override with `AUTOMIGRATE_HOME`).
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
automigrate init # see detected stack + suggested targets
|
|
43
|
+
automigrate run --target javascript-to-typescript # full migration
|
|
44
|
+
automigrate run --target python-to-python3 --dry-run # preview the plan only
|
|
45
|
+
automigrate run --target javascript-to-typescript --resume # continue after a failure
|
|
46
|
+
automigrate rollback # undo the most recent migration
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Authentication
|
|
50
|
+
|
|
51
|
+
AutoMigrate calls the Claude API and needs an Anthropic API key, resolved in this order:
|
|
52
|
+
|
|
53
|
+
1. `~/.automigrate/config.json` (set via `automigrate config set-key <key>`)
|
|
54
|
+
2. the `ANTHROPIC_API_KEY` environment variable
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
automigrate config set-key sk-ant-...
|
|
58
|
+
# or
|
|
59
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|