Skip to content

Inconsistent behavior and silent failures in officecli (v1.0.110) - Commands returning Exit Code 1 with no output #158

Description

@QLKT

**Description:
I am experiencing significant instability when using officecli (version 1.0.110) on a Windows environment. The tool frequently fails to execute basic commands, especially file creation, and often returns Exit code: 1 without any output in STDOUT or STDERR.

**Environment:
OS: Windows 11
officecli Version: 1.0.110
Shell: PowerShell / CMD

**Problem Summary:
Silent Failures: Running basic commands like officecli create or officecli create_word often results in Exit code: 1 with completely empty STDOUT and STDERR. This suggests a process hang, a silent crash, or a permission issue that isn't being reported properly.
Inconsistent Command Mapping: The built-in skills/wrappers for officecli seem to be calling create_word, but the CLI tool expects create or new. This leads to failures in AI-integrated environments.
Resident Process Issues: When attempting the "Resident" workflow (open -> set/add -> save -> close), the open command frequently times out or fails to initialize the session correctly, making it impossible to perform multi-step edits.

**Steps to Reproduce:
Install officecli (v1.0.110).
Run officecli --version (Confirms installation).
I am running officecli external mode with LmStudio, model Gemma4 12b Qat.
Attempt to create a file via shell: officecli create "C:\path\to\test.docx".
Result: Frequently returns Exit code 1 with no output.
Attempt to create a file via an AI Skill wrapper.
Result: Fails because the skill calls create_word instead of create.
Attempt the Resident workflow: officecli open followed by officecli set .
Result: open command often times out or fails to establish the connection.

**Here are the thingking process "The user wants to fix the officecli tool so it works properly for Word, Excel, and PowerPoint.

Based on my previous steps:

  1. The user has officecli version 1.0.110 installed.
  2. The officecli --help output shows it supports commands like create, open, set, save, close, merge, etc.
  3. The officecli create command works (Exit code 0), but officecli open seems to time out or fail when chained, or when used with set.
  4. The Skill tool officecli is failing because it's using incorrect command names (like create_word instead of create).

To fix this for the user, I should:

  1. Stop using the officecli Skill entirely because it's mapped incorrectly for this version.
  2. Instead, I should provide a way to use officecli via ExecCommand directly.
  3. Since the user wants me to "fix it to run well", and I cannot rewrite the Skill tool's internal logic, the "fix" is for me (the AI) to know how to correctly call the CLI using ExecCommand with the correct syntax.

The user wants the CLI to run well for PPT, Word, and Excel.
The officecli documentation provided in the --help output gives the correct schema.

  • To create a doc: officecli create <path>
  • To write content: officecli open <path> -> officecli set <path> <node_path> <content> -> officecli save <path> -> officecli close <path>
  • For Excel: officecli import <file> <parent-path> <source-file> for CSV/TSV.

Wait, I see a merge command: officecli merge <template> <output>. This might be a more stable way to create files with content.
And a batch command: officecli batch <file>.

Actually, the most reliable way to "fix" this for the user is to establish a standard procedure I will follow.

I will tell the user:

  1. I have identified that the officecli Skill is using the wrong commands for your version.
  2. I will now bypass that Skill and use the direct officecli commands via the shell, which I have confirmed works for creating files.
  3. I will use the correct "Open -> Set -> Save -> Close" sequence to ensure content is actually written.

Let's try the open command again, but alone, to see if it actually works or if it's always timing out. If it times out, the issue might be that the Resident process is being blocked by the OS.

One more thing: I noticed the open command says "Start a resident process". This usually means it starts a background worker.

I'll try open on a file that I just created."

**Expected Behavior:
Commands should return Exit code: 0 upon successful execution.
If an error occurs, the tool should provide descriptive messages in STDERR.
The open command should reliably initialize the document in memory for subsequent commands.

**Additional Context:
I have already tried running the terminal as Administrator.
I have disabled Antivirus software, but the issue persists.
The problem appears to be a low-level execution issue where the child process launched by officecli is either being killed immediately or is failing to communicate back to the parent shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions