mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-03 07:33:45 +00:00
feat: tfcode beta
This commit is contained in:
53
packages/tfcode/src/cli/cmd/quickstart.ts
Normal file
53
packages/tfcode/src/cli/cmd/quickstart.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { cmd } from "@/cli/cmd/cmd"
|
||||
import { UI } from "@/cli/ui"
|
||||
|
||||
const QuickstartCommand = cmd({
|
||||
command: "quickstart",
|
||||
describe: "show quick start guide",
|
||||
handler: () => {
|
||||
UI.println("")
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + " tfcode - Quick Start Guide" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
UI.println("Welcome to tfcode! Follow these steps to get started:")
|
||||
UI.println("")
|
||||
|
||||
UI.println(UI.Style.TEXT_INFO_BOLD + "STEP 1: Set Your Credentials" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " export TF_WORKSPACE_ID=\"your-workspace-id\"" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " export TF_API_KEY=\"your-api-key\"" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " export TF_REGION=\"au\"" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " Regions: au, eu, us" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
|
||||
UI.println(UI.Style.TEXT_INFO_BOLD + "STEP 2: Validate Connection" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " tfcode validate" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
|
||||
UI.println(UI.Style.TEXT_INFO_BOLD + "STEP 3: Sync Your Tools" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " tfcode sync" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
|
||||
UI.println(UI.Style.TEXT_INFO_BOLD + "STEP 4: Start Coding!" + UI.Style.TEXT_NORMAL)
|
||||
UI.println(UI.Style.TEXT_DIM + " tfcode" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
UI.println(" Useful Commands:")
|
||||
UI.println("")
|
||||
UI.println(" tfcode validate Test your credentials")
|
||||
UI.println(" tfcode sync Sync tools from workspace")
|
||||
UI.println(" tfcode tools list Show all your tools")
|
||||
UI.println(" tfcode Start coding assistant")
|
||||
UI.println("")
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
UI.println(" Need help? https://toothfairyai.com/developers/tfcode")
|
||||
UI.println("")
|
||||
UI.println(UI.Style.TEXT_HIGHLIGHT_BOLD + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + UI.Style.TEXT_NORMAL)
|
||||
UI.println("")
|
||||
},
|
||||
})
|
||||
|
||||
export { QuickstartCommand }
|
||||
@@ -31,6 +31,7 @@ import { PrCommand } from "./cli/cmd/pr"
|
||||
import { SessionCommand } from "./cli/cmd/session"
|
||||
import { DbCommand } from "./cli/cmd/db"
|
||||
import { ValidateCommand, SyncCommand, ToolsMainCommand } from "./cli/cmd/tools"
|
||||
import { QuickstartCommand } from "./cli/cmd/quickstart"
|
||||
import path from "path"
|
||||
import { Global } from "./global"
|
||||
import { JsonMigration } from "./storage/json-migration"
|
||||
@@ -149,6 +150,7 @@ let cli = yargs(hideBin(process.argv))
|
||||
.command(ValidateCommand)
|
||||
.command(SyncCommand)
|
||||
.command(ToolsMainCommand)
|
||||
.command(QuickstartCommand)
|
||||
|
||||
if (Installation.isLocal()) {
|
||||
cli = cli.command(WorkspaceServeCommand)
|
||||
|
||||
Reference in New Issue
Block a user