Skip to content

Comments

feat(cli): add plugin install and agent logs subcommands ( Task 6 )#281

Merged
lijingrs merged 3 commits intomofa-org:mainfrom
Gitjay11:feature/cli-subcommands
Feb 23, 2026
Merged

feat(cli): add plugin install and agent logs subcommands ( Task 6 )#281
lijingrs merged 3 commits intomofa-org:mainfrom
Gitjay11:feature/cli-subcommands

Conversation

@Gitjay11
Copy link
Contributor

@Gitjay11 Gitjay11 commented Feb 23, 2026

📋 Summary

Fleshes out the mofa-cli tool by implementing the routing and structural stubs for two practical and highly requested subcommands: mofa plugin install and mofa agent logs <agent_id> [--tail]. These additions provide a more complete out-of-the-box CLI experience for managing background agents and plugins.

🔗 Related Issues

Closes #213

🧠 Context

Currently, the mofa-cli has a solid foundation for managing agents and plugins but is missing some commands that developers expect:

  1. It supports viewing (list, info) and removing (uninstall) plugins, but lacks the subcommand to install them.
  2. It supports starting, stopping, and restarting agents, but doesn't have a built-in way to view out-of-band logs for background execution.

By adding these Subcommands to clap, we open the door for standardizing these workflows within the MoFA CLI.


🛠️ Changes

  • Added Install to PluginCommands in cli.rs
  • Added Logs to AgentCommands in cli.rs definition (including boolean --tail argument support)
  • Implemented commands/plugin/install.rs following the existing stub module pattern
  • Implemented commands/agent/logs.rs following the existing stub module pattern
  • Handled pattern matching and routing in main.rs for both new commands

🧪 How you Tested

  1. Verified code compiles safely without warnings via cargo clippy.
  2. Ran cargo run -p mofa-cli -- --help to ensure new commands are documented properly.
  3. Ran cargo run -p mofa-cli -- plugin install my-plugin and successfully received the mock installation success message.
  4. Ran cargo run -p mofa-cli -- agent logs my-agent --tail and observed the mock daemon log output gracefully running.

📸 Screenshots / Logs (if applicable)

$ mofa plugin install my-test-plugin
→ Installing plugin: my-test-plugin
✓ Plugin 'my-test-plugin' installed successfully

⚠️ Breaking Changes

  • No breaking changes
  • Breaking change (describe below)

🧹 Checklist

Code Quality

  • Code follows Rust idioms and project conventions
  • cargo fmt run
  • cargo clippy passes without warnings

Testing

  • Tests added/updated
  • cargo test passes locally without any error

Documentation

  • Public APIs documented

PR Hygiene

  • PR is small and focused (one logical change)
  • Branch is up to date with main
  • No unrelated commits
  • Commit messages explain why, not only what

🚀 Deployment Notes (if applicable)

N/A

🧩 Additional Notes for Reviewers

Just a heads up on my approach here:

  1. I followed the established "one file per subcommand" pattern.
  2. I used stub logic with // TODO comments, exactly matching how files like [src/commands/agent/start.rs] are currently set up.
  3. The goal of this PR is to finalize the CLI routing so the foundation is 100% ready for the actual core business logic to be plugged in later.

@lijingrs @BH3GEI

@Gitjay11 Gitjay11 force-pushed the feature/cli-subcommands branch from f03211f to 1891672 Compare February 23, 2026 05:18
@Gitjay11
Copy link
Contributor Author

Gitjay11 commented Feb 23, 2026

Hi @BH3GEI @lijingrs You can review this PR, if any change is required then it would be my pleasure to update it.
The changes are correct, but the checks are still failing

@lijingrs
Copy link
Collaborator

The check failed; it appears the branch code is not up to date.

@Gitjay11
Copy link
Contributor Author

Gitjay11 commented Feb 23, 2026

hi @lijingrs, it is up to date now
All checks have passed

@lijingrs lijingrs merged commit c2e7fc2 into mofa-org:main Feb 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Implement 'mofa plugin install' and 'mofa agent logs' CLI subcommands (Task 6)

2 participants