Skip to content

Can't init my project #2269

Closed
Closed

Description

@amber-moe

I jump to the path to my project. Then run opencode, then /init. But something went wrong.

ambermoe@U-4512X229-2148 ai-write-code % pwd
/Users/ambermoe/Desktop/ai-write-code
ambermoe@U-4512X229-2148 ai-write-code % opencode
ambermoe@U-4512X229-2148 ai-write-code % /init
zsh: no such file or directory: /init
ambermoe@U-4512X229-2148 ai-write-code % /init
zsh: no such file or directory: /init
ambermoe@U-4512X229-2148 ai-write-code % init
zsh: command not found: init
ambermoe@U-4512X229-2148 ai-write-code % opencode init
Error: Failed to change directory to /Users/ambermoe/Desktop/ai-write-code/init

I'm using Ghossty, Version 1.1.3. Any ideas? macOS Sequoia Version 15.1.1

opencode --version
0.5.28

Claude Anthropic manually enter the key.

Activity

  1. github-actions commented on Aug 27, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The /init command should be used inside the opencode TUI, not as a shell command. Try:

    1. Run opencode to enter the TUI
    2. Type /init in the chat interface (not in your shell)

    The error opencode init occurs because opencode is looking for a directory named 'init', which doesn't exist.

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Aug 27, 2025

    @rekram1-node
    Contributor

    maybe you misunderstand how opencode works, but opencode should launch the tui, then you type /init and hit enter. This is a slash command

  3. johnjelinek commented on Sep 2, 2025

    @johnjelinek

    for me, it only outputs a json response without creating an AGENTS.md:

    I'll analyze the codebase to create an AGENTS.md file with build/lint/test
    commands and code style guidelines. First, let me check for existing
    AGENTS.md or relevant configuration files.

    [{"name": "read", "arguments": {"filePath": "/AGENTS.md"}}, {"name":
    "list", "arguments": {"path": "/", "ignore": ["node_modules/", "target/",
    ".git/"]}}, {"name": "read", "arguments": {"filePath": "/package.json"}},
    {"name": "read", "arguments": {"filePath": "/.cursor/rules"}}, {"name":
    "read", "arguments": {"filePath": "/.github/copilot-instructions.md"}}]

    < continue

    I need to continue working on the task. Let me check the status of our
    analysis and see what we've accomplished so far.

    Let's start by examining the current state of the codebase, specifically
    looking at the relevant files that would need modification for this fix.

    List /home/user/project

    Error: ENOENT: no such file or directory, open '/home/user/project

    but that's not my current working directory ☝️

  4. rekram1-node commented on Sep 2, 2025

    @rekram1-node
    Contributor

    @johnjelinek what model are you using? Can you maybe send a /share link?

  5. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    This model: hf.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:UD-Q4_K_XL -- I think I was able to generate an AGENTS.md by increasing the context, ie: OLLAMA_CONTEXT_LENGTH=12288 ollama serve

  6. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    Ahh can you replicate the issue after setting that? I think that was the recommended ollama fix as of this issue: #1068

  7. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    I think this may just be ollama thing

  8. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    that comment in #1068 is what inspired me to give it a try. However, it doesn't work with the deepseek-r1 models because the parameter is hardcoded into the model template. So, for those, you gotta:

    ollama run deepseek-r1:8b
    /set parameter num_ctx 12288
    /save deepseek-r1:8b-12k

    and then use that model in your config: deepseek-r1:8b-12k

  9. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    that being said, I'm not sure why that would make this unique to ollama. Wouldn't llama-server have the same issue?

  10. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    Possibly, I don't know for certain I just know 99% of the time I see these issues it is someone using ollama, those using LMStudio generally have better success

  11. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    have you had success with running locally (not necessarily ollama, you could do llama-server or llama-cpp-python[server]) with ~32GB RAM on a ~17GB sized model and a limited context window (8192)?

  12. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    haven't tried tbh

  13. nickkadutskyi commented on Sep 5, 2025

    @nickkadutskyi

    I am having a similar problem.
    I used cd into a project and then just run opencode. Now I get this error:
    Error: Failed to change directory to /Users/nick/Documents/ucms/opencode
    Apparently it requires now to provide a path to a project, and if you don't provide it it will use ./opencode as a path (pretty random). So running opencode . fixes the issue.

  14. rekram1-node commented on Sep 5, 2025

    @rekram1-node
    Contributor

    @nickkadutskyi that's definitely unexpected... how did you install opencode?

  15. nickkadutskyi commented on Sep 5, 2025

    @nickkadutskyi

    @rekram1-node via nixpkgs, but I don't think it matters since it worked well before.

  16. nickkadutskyi commented on Sep 5, 2025

    @nickkadutskyi

    Here is some output:

    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖
    % nix run github:NixOS/nixpkgs/nixpkgs-unstable#opencode -- --version
    0.6.3
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖
    % nix run github:NixOS/nixpkgs/nixos-25.05#opencode -- --version
    0.3.112
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖  took 30s
    % nix run github:NixOS/nixpkgs/nixpkgs-unstable#opencode --
    Error: Failed to change directory to /nix/store/4sppwfm02d88gfih4113zblr4jic4jp7-opencode-0.6.3/bin/opencode
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖
    % nix run github:NixOS/nixpkgs/nixos-25.05#opencode --
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖  took 4s
    % which opencode
    /etc/profiles/per-user/nick/bin/opencode
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖
    % opencode --version
    0.6.3
    ucms 󰘬 main↑1 n/d +69-11 󰇂 󱄅 󰻍 (devenv-shell-env) 󰏖
    % opencode
    Error: Failed to change directory to /Users/nick/Documents/ucms/opencode

    (In this case /etc/profiles/per-user/nick/bin/opencode is /nix/store/4sppwfm02d88gfih4113zblr4jic4jp7-opencode-0.6.3/bin/opencode )
    Only 0.3.112 worked right, but I think all 0.4.* and 0.5.* versions worked.

  17. rekram1-node commented on Sep 5, 2025

    @rekram1-node
    Contributor

    @nickkadutskyi that makes sense, I only see people having issue when they install from nix

  18. nickkadutskyi commented on Sep 5, 2025

    @nickkadutskyi

    @rekram1-node actually just checked it if install via via npm and it works properly, both 0.6.3 and 0.6.4

  19. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions