{"modulePath":"github.com/kernel/cli","version":"v0.54.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package create\n\n## Constants\n\n```go\nconst (\n\tDIR_PERM  = 0755 // rwxr-xr-x\n\tFILE_PERM = 0644 // rw-r--r--\n)\n```\n\n```go\nconst (\n\tTemplateSampleApp            = \"sample-app\"\n\tTemplateCaptchaSolver        = \"captcha-solver\"\n\tTemplateAnthropicComputerUse = \"anthropic-computer-use\"\n\tTemplateOpenAIComputerUse    = \"openai-computer-use\"\n\tTemplateGeminiComputerUse    = \"gemini-computer-use\"\n\tTemplateBrowserUse           = \"browser-use\"\n\tTemplateStagehand            = \"stagehand\"\n\tTemplateOpenAGIComputerUse   = \"openagi-computer-use\"\n\tTemplateClaudeAgentSDK       = \"claude-agent-sdk\"\n\tTemplateYutoriComputerUse    = \"yutori\"\n\tTemplateTzafonComputerUse    = \"tzafon\"\n)\n```\nTemplate key constants\n\n```go\nconst (\n\tDefaultAppName = \"my-kernel-app\"\n\tAppNamePrompt  = \"What is the name of your project?\"\n\tLanguagePrompt = \"Choose a programming language:\"\n\tTemplatePrompt = \"Select a template:\"\n)\n```\n\n```go\nconst (\n\tLanguageTypeScript          = \"typescript\"\n\tLanguagePython              = \"python\"\n\tLanguageShorthandTypeScript = \"ts\"\n\tLanguageShorthandPython     = \"py\"\n)\n```\n\n## Variables\n\n```go\nvar Commands = map[string]map[string]DeployConfig{\n\tLanguageTypeScript: {\n\t\tTemplateSampleApp: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  false,\n\t\t\tInvokeCommand: `kernel invoke ts-basic get-page-title --payload '{\"url\": \"https://www.google.com\"}'`,\n\t\t},\n\t\tTemplateCaptchaSolver: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  false,\n\t\t\tInvokeCommand: \"kernel invoke ts-captcha-solver test-captcha-solver\",\n\t\t},\n\t\tTemplateStagehand: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-stagehand teamsize-task --payload '{\"company\": \"Kernel\"}'`,\n\t\t},\n\t\tTemplateAnthropicComputerUse: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-anthropic-cua cua-task --payload '{\"query\": \"Navigate to http://magnitasks.com and click on Tasks in the sidebar\"}'`,\n\t\t},\n\t\tTemplateOpenAIComputerUse: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-openai-cua cua-task --payload '{\"task\": \"Go to https://news.ycombinator.com and get the top 5 articles\"}'`,\n\t\t},\n\t\tTemplateGeminiComputerUse: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-gemini-cua cua-task --payload '{\"query\": \"Navigate to http://magnitasks.com and click on Tasks in the sidebar\"}'`,\n\t\t},\n\t\tTemplateClaudeAgentSDK: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-claude-agent-sdk agent-task --payload '{\"task\": \"Go to https://news.ycombinator.com and get the top 3 stories\"}'`,\n\t\t},\n\t\tTemplateYutoriComputerUse: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-yutori-cua cua-task --payload '{\"query\": \"Navigate to https://www.yutori.com and list the team member names.\"}'`,\n\t\t},\n\t\tTemplateTzafonComputerUse: {\n\t\t\tEntryPoint:    \"index.ts\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke ts-tzafon-cua cua-task --payload '{\"query\": \"Go to wikipedia.org and search for Alan Turing\"}'`,\n\t\t},\n\t},\n\tLanguagePython: {\n\t\tTemplateSampleApp: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  false,\n\t\t\tInvokeCommand: `kernel invoke python-basic get-page-title --payload '{\"url\": \"https://www.google.com\"}'`,\n\t\t},\n\t\tTemplateCaptchaSolver: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  false,\n\t\t\tInvokeCommand: \"kernel invoke python-captcha-solver test-captcha-solver\",\n\t\t},\n\t\tTemplateBrowserUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-bu bu-task --payload '{\"task\": \"Compare the price of gpt-4o and DeepSeek-V3\"}'`,\n\t\t},\n\t\tTemplateAnthropicComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-anthropic-cua cua-task --payload '{\"query\": \"Navigate to http://magnitasks.com and click on Tasks in the sidebar\"}'`,\n\t\t},\n\t\tTemplateOpenAIComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-openai-cua cua-task --payload '{\"task\": \"Go to https://news.ycombinator.com and get the top 5 articles\"}'`,\n\t\t},\n\t\tTemplateOpenAGIComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-openagi-cua openagi-default-task -p '{\"instruction\": \"Navigate to https://agiopen.org and click the What is Computer Use? button\", \"record_replay\": \"True\"}'`,\n\t\t},\n\t\tTemplateClaudeAgentSDK: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke py-claude-agent-sdk agent-task --payload '{\"task\": \"Go to https://news.ycombinator.com and get the top 3 stories\"}'`,\n\t\t},\n\t\tTemplateGeminiComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-gemini-cua cua-task --payload '{\"query\": \"Navigate to http://magnitasks.com and click on Tasks in the sidebar\"}'`,\n\t\t},\n\t\tTemplateYutoriComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-yutori-cua cua-task --payload '{\"query\": \"Navigate to https://www.yutori.com and list the team member names.\"}'`,\n\t\t},\n\t\tTemplateTzafonComputerUse: {\n\t\t\tEntryPoint:    \"main.py\",\n\t\t\tNeedsEnvFile:  true,\n\t\t\tInvokeCommand: `kernel invoke python-tzafon-cua cua-task --payload '{\"query\": \"Go to wikipedia.org and search for Alan Turing\"}'`,\n\t\t},\n\t},\n}\n```\n\n```go\nvar InstallCommands = map[string]string{\n\tLanguageTypeScript: \"pnpm install\",\n\tLanguagePython:     \"uv venv\",\n}\n```\n\n```go\nvar RequiredTools = Tools{\n\tLanguageTypeScript: \"pnpm\",\n\tLanguagePython:     \"uv\",\n}\n```\n\n```go\nvar SupportedLanguages = []string{\n\tLanguageTypeScript,\n\tLanguagePython,\n}\n```\nSupportedLanguages returns a list of all supported languages\n\n```go\nvar Templates = map[string]TemplateInfo{\n\tTemplateSampleApp: {\n\t\tName:        \"Sample App\",\n\t\tDescription: \"Implements a basic Kernel app\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateCaptchaSolver: {\n\t\tName:        \"CAPTCHA Solver\",\n\t\tDescription: \"Demo of Kernel's auto-CAPTCHA solving capability\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateAnthropicComputerUse: {\n\t\tName:        \"Anthropic Computer Use\",\n\t\tDescription: \"Implements an Anthropic computer use agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateOpenAIComputerUse: {\n\t\tName:        \"OpenAI Computer Use\",\n\t\tDescription: \"Implements an OpenAI computer use agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateGeminiComputerUse: {\n\t\tName:        \"Gemini Computer Use\",\n\t\tDescription: \"Implements a Gemini computer use agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateBrowserUse: {\n\t\tName:        \"Browser Use\",\n\t\tDescription: \"Implements Browser Use SDK\",\n\t\tLanguages:   []string{LanguagePython},\n\t},\n\tTemplateStagehand: {\n\t\tName:        \"Stagehand\",\n\t\tDescription: \"Implements the Stagehand v3 SDK\",\n\t\tLanguages:   []string{LanguageTypeScript},\n\t},\n\tTemplateOpenAGIComputerUse: {\n\t\tName:        \"OpenAGI Computer Use\",\n\t\tDescription: \"Implements an OpenAGI computer use agent\",\n\t\tLanguages:   []string{LanguagePython},\n\t},\n\tTemplateClaudeAgentSDK: {\n\t\tName:        \"Claude Agent SDK\",\n\t\tDescription: \"Implements a Claude Agent SDK browser automation agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateYutoriComputerUse: {\n\t\tName:        \"Yutori n1.5 Computer Use\",\n\t\tDescription: \"Implements a Yutori n1.5 computer use agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n\tTemplateTzafonComputerUse: {\n\t\tName:        \"Tzafon Northstar Computer Use\",\n\t\tDescription: \"Implements a Tzafon Northstar CUA Fast computer use agent\",\n\t\tLanguages:   []string{LanguageTypeScript, LanguagePython},\n\t},\n}\n```\n\n## Functions\n\n```go\nfunc CopyTemplateFiles(appPath, language, template string) error\n```\nCopyTemplateFiles copies all files and directories from the specified embedded template into the target application path. It uses the given language and template names to locate the template inside the embedded filesystem.\n\n  - appPath: filesystem path where the files should be written (the project directory)\n  - language: language subdirectory (e.g., \"typescript\")\n  - template: template subdirectory (e.g., \"sample-app\")\n\nThe function will recursively walk through the embedded template directory and replicate all files and folders in appPath. If a file named \"\\_gitignore\" is encountered, it is renamed to \".gitignore\" in the output, to work around file embedding limitations.\n\nReturns an error if the template path is invalid, empty, or if any file operations fail.\n\n```go\nfunc GetDeployCommand(language, template string) string\n```\nGetDeployCommand returns the full deploy command string for a given language and template\n\n```go\nfunc GetInvokeSample(language, template string) string\n```\nGetInvokeSample returns the sample invoke command for a given language and template\n\n```go\nfunc InstallDependencies(appPath string, ci CreateInput) (string, error)\n```\nInstallDependencies sets up project dependencies based on language\n\n```go\nfunc LanguageShorthand(language string) string\n```\nLanguageShorthand returns the shorthand for a canonical language name, or an empty string if the language has no shorthand. Inverse of NormalizeLanguage.\n\n```go\nfunc NormalizeLanguage(language string) string\n```\nHelper to normalize language input (handle shorthand)\n\n```go\nfunc ProblemMessages(problems []Problem) []string\n```\nProblemMessages extracts the messages from problems, in order.\n\n```go\nfunc PromptLanguage(p interactive.Prompter) (string, error)\n```\nPromptLanguage prompts for the application language.\n\n```go\nfunc PromptName(p interactive.Prompter) (string, error)\n```\nPromptName prompts for the app name. An empty entry falls back to DefaultAppName.\n\n```go\nfunc PromptOverwrite(p interactive.Prompter, dirName string) (bool, error)\n```\nPromptOverwrite asks for confirmation before overwriting an existing directory.\n\n```go\nfunc PromptTemplate(p interactive.Prompter, language string) (string, error)\n```\nPromptTemplate prompts for a template supported by the given (normalized) language.\n\n```go\nfunc ResolveInput(raw RawInput) (CreateInput, []Problem)\n```\nResolveInput is the single canonical resolver from raw flag values to a normalized CreateInput. It validates and normalizes every field, collecting a Problem for each one that is missing, invalid, or (for an existing target directory) would require an overwrite confirmation. It never prompts, but every Problem it emits carries the prompt step that resolves it.\n\nBoth modes of \\`kernel create\\` consume its problem model: the interactive flow resolves one problem at a time and re-resolves, while the non-interactive flow reports all problems in a single fail-fast error. Problems are ordered name, language, template, overwrite so interactive resolution fixes the language before the language-dependent template list is needed.\n\nThe returned CreateInput carries the fields that did resolve (with the language normalized) even when problems remain.\n\n## Types\n\n```go\ntype CreateInput struct {\n\tName     string\n\tLanguage string\n\tTemplate string\n\t// SkipConfirm skips confirmation prompts (e.g. overwriting an existing\n\t// directory). Set via the --yes flag.\n\tSkipConfirm bool\n}\n```\n\n```go\ntype DeployConfig struct {\n\tEntryPoint    string\n\tNeedsEnvFile  bool\n\tInvokeCommand string\n}\n```\n\n```go\ntype Field string\n```\nField identifies a scaffolding input that a Problem refers to.\n\n```go\nconst (\n\tFieldName      Field = \"name\"\n\tFieldLanguage  Field = \"language\"\n\tFieldTemplate  Field = \"template\"\n\tFieldOverwrite Field = \"overwrite\"\n)\n```\n\n```go\ntype Problem struct {\n\tField   Field\n\tMessage string\n\t// Invalid marks that a value was provided but rejected (as opposed to\n\t// missing); the interactive flow warns with Message before prompting.\n\tInvalid bool\n\t// contains filtered or unexported fields\n}\n```\nProblem describes one input that is missing, invalid, or would require a confirmation. Message is phrased as the non-interactive fix instruction (naming the exact flag to pass); the interactive flow surfaces the same message as a warning before prompting for the field.\n\n```go\nfunc (pr Problem) Resolve(p interactive.Prompter, raw *RawInput) (cancelled bool, err error)\n```\nResolve prompts for this problem's field via p and applies the answer to raw. cancelled reports that the user declined a confirmation and the operation should stop.\n\n```go\ntype RawInput struct {\n\tName     string\n\tLanguage string\n\tTemplate string\n\t// SkipOverwriteConfirm is set by --yes, or after the user interactively\n\t// confirms overwriting an existing directory.\n\tSkipOverwriteConfirm bool\n}\n```\nRawInput carries the raw \\`kernel create\\` flag values before resolution.\n\n```go\ntype TemplateInfo struct {\n\tName        string\n\tDescription string\n\tLanguages   []string\n}\n```\n\n```go\ntype TemplateKeyValue struct {\n\tKey   string\n\tValue string\n}\n```\n\n```go\ntype TemplateKeyValues []TemplateKeyValue\n```\n\n```go\nfunc GetSupportedTemplatesForLanguage(language string) TemplateKeyValues\n```\nGetSupportedTemplatesForLanguage returns a list of all supported template names for a given language\n\n```go\nfunc (tkv TemplateKeyValues) ContainsKey(key string) bool\n```\nContainsKey checks if a template key exists in the TemplateKeyValues\n\n```go\nfunc (tkv TemplateKeyValues) GetTemplateDisplayValues() []string\n```\nGetTemplateDisplayValues extracts display values from TemplateKeyValue slice\n\n```go\nfunc (tkv TemplateKeyValues) GetTemplateKeyFromValue(selectedValue string) (string, error)\n```\nGetTemplateKeyFromValue maps the selected display value back to the template key\n\n```go\ntype Tools map[string]string\n```\n\n```go\nfunc (t Tools) CheckToolAvailable(tool string) bool\n```\n\n","path":"github.com/kernel/cli/pkg/create","name":"create","synopsis":"","isRedistributable":true}
