Skip to content

Bug report - starting cecli outside of a git repo causes AttributeError #421

@synth-mania

Description

@synth-mania

Issue

<redacted>:~$ cecli
You should probably run cecli in your project's directory, not your home dir.

https://github.com/dwash96/cecli/releases/latest
Would you like to see what's new in this version? (Y)es/(N)o [Yes]: n
Starting cecli TUI...
╭─────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────╮
│ /home/<redacted>/.local/share/uv/tools/cecli-dev/lib/python3.12/site-packages/cecli/tui/app.py:277 in compose                                                                              │
│                                                                                                                                                                                          │
│    274 │   │   yield KeyHints(id="key-hints")                                                                                                                                            │
│    275 │   │   yield MainFooter(                                                                                                                                                         │
│    276 │   │   │   model_name=model_name,                                                                                                                                                │
│ ❱  277 │   │   │   project_name=str(coder.repo.root) if len(str(coder.repo.root)) <= 64 else pr                                                                                          │
│    278 │   │   │   git_branch="",  # Loaded async in on_mount                                                                                                                            │
│    279 │   │   │   coder_mode=coder_mode,                                                                                                                                                │
│    280 │   │   │   id="footer",                                                                                                                                                          │
│                                                                                                                                                                                          │
│ ╭───────────────────────────────────────── locals ──────────────────────────────────────────╮                                                                                            │
│ │        coder = <cecli.coders.editblock_coder.EditBlockCoder object at 0x7fa702de8740>     │                                                                                            │
│ │   coder_mode = 'diff'                                                                     │                                                                                            │
│ │ history_file = '.cecli/input.history'                                                     │                                                                                            │
│ │   model_name = 'openai/mistralai/devstral-small-2-2512'                                   │                                                                                            │
│ │ project_name = 'No Repo'                                                                  │                                                                                            │
│ │         self = TUI(title='TUI', classes={'-dark-mode'}, pseudo_classes={'focus', 'dark'}) │                                                                                            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────╯                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'root'
<redacted>:~$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
hint: to use in all of your new repositories, which will suppress this warning,
hint: call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in <redacted>/.git/
<redacted>:~$ cecli
You can skip this check with --no-gitignore
Add .cecli* to .gitignore (recommended)? (Y)es/(N)o [Yes]:
Added .cecli* to .gitignore
Starting cecli TUI...

cecli complains when I start execute the application in my home directory, but appears to run into an issue related to the fact that I was running it outside of any git repo. See the traceback above, which demonstrates the source of the AttributeError

To gauge baseline behavior, I initialized an empty git repo in the same directory, and ran cecli with no issues.

Version and model info

cecli 0.96.6
model: NA
git repo: NA
repo map: NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions