mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-28 05:04:23 +01:00
Refactor application path handling and data storage architecture
Replace simple directory-based path system with git-aware data management that uses global data directories and proper workspace detection. 🤖 Generated with opencode Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
@@ -16,9 +16,10 @@ declare global {
|
||||
}
|
||||
|
||||
const cli = cac("opencode")
|
||||
const version = typeof OPENCODE_VERSION === "string" ? OPENCODE_VERSION : "dev"
|
||||
|
||||
cli.command("", "Start the opencode in interactive mode").action(async () => {
|
||||
await App.provide({ directory: process.cwd() }, async () => {
|
||||
await App.provide({ cwd: process.cwd(), version }, async () => {
|
||||
await Share.init()
|
||||
const server = Server.listen()
|
||||
|
||||
@@ -66,14 +67,14 @@ cli
|
||||
.command("run [...message]", "Run a chat message")
|
||||
.option("--session <id>", "Session ID")
|
||||
.action(async (message: string[], options) => {
|
||||
await App.provide({ directory: process.cwd() }, async () => {
|
||||
await App.provide({ cwd: process.cwd(), version }, async () => {
|
||||
await Share.init()
|
||||
const session = options.session
|
||||
? await Session.get(options.session)
|
||||
: await Session.create()
|
||||
console.log("Session:", session.id)
|
||||
|
||||
Bus.subscribe(Message.Event.Updated, async (message) => {
|
||||
Bus.subscribe(Message.Event.Updated, async () => {
|
||||
console.log("Thinking...")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user