feat: update AI command to streamline token management and remove unnecessary flags

This commit is contained in:
2025-11-04 18:17:56 +08:00
parent 3867736858
commit ad8ca2b1f7
9 changed files with 265 additions and 327 deletions

View File

@@ -53,19 +53,18 @@ func TestAIPreviewFlowRendersSequenceTable(t *testing.T) {
createAIPreviewFile(t, filepath.Join(root, "promo SALE 01.JPG"))
createAIPreviewFile(t, filepath.Join(root, "family_photo.png"))
t.Setenv("default_MODEL_AUTH_TOKEN", "test-token")
t.Setenv("OPENAI_TOKEN", "test-token")
rootCmd := renamercmd.NewRootCommand()
var stdout, stderr bytes.Buffer
rootCmd.SetOut(&stdout)
rootCmd.SetErr(&stderr)
exportPath := filepath.Join(root, "plan.json")
exportPath := filepath.Join(root, "renamer.plan.json")
rootCmd.SetArgs([]string{
"ai",
"--path", root,
"--dry-run",
"--debug-genkit",
"--export-plan", exportPath,
})
if err := rootCmd.Execute(); err != nil {