mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
Update index.ts
🤖 Generated with [OpenCode](https://opencode.ai) Co-Authored-By: OpenCode <noreply@opencode.ai>
This commit is contained in:
parent
3e086e3ab9
commit
d4d218d7d6
1 changed files with 9 additions and 2 deletions
|
@ -35,12 +35,19 @@ const cli = yargs(hideBin(process.argv))
|
|||
})
|
||||
.usage("\n" + UI.logo())
|
||||
.command({
|
||||
command: "$0",
|
||||
command: "$0 <project>",
|
||||
describe: "Start OpenCode TUI",
|
||||
builder: (yargs) =>
|
||||
yargs.positional("project", {
|
||||
type: "string",
|
||||
describe: "path to start opencode in",
|
||||
}),
|
||||
handler: async (args) => {
|
||||
while (true) {
|
||||
const cwd = args.project ? path.resolve(args.project) : process.cwd()
|
||||
process.chdir(cwd)
|
||||
const result = await App.provide(
|
||||
{ cwd: process.cwd(), version: VERSION },
|
||||
{ cwd, version: VERSION },
|
||||
async () => {
|
||||
const providers = await Provider.list()
|
||||
if (Object.keys(providers).length === 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue