Skip to content

feat: CLI initial commit#493

Merged
frol merged 7 commits into
mainfrom
feat/cli
Apr 17, 2026
Merged

feat: CLI initial commit#493
frol merged 7 commits into
mainfrom
feat/cli

Conversation

@frol

@frol frol commented Apr 14, 2026

Copy link
Copy Markdown
Member
image

There are still a couple of bugs here and there, but it mostly works.

This PR is blocked on near/near-cli-rs#583

Copilot AI review requested due to automatic review settings April 14, 2026 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the initial trezu Rust CLI (nt-cli) for interacting with the Trezu backend and NEAR DAO treasuries, including authentication, treasury introspection, proposal management, and creating/relaying delegate-action based transactions via near-cli-rs.

Changes:

  • Add a new nt-cli crate implementing interactive commands: login/logout/whoami, treasury list/info, assets/activity, members, address book CRUD, proposals list/view/approve/reject, and payment proposal creation (public + confidential intents path).
  • Add a blocking HTTP API client and JSON types for Trezu backend endpoints.
  • Update repo .gitignore to ignore Rust target/ artifacts at the repo root.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
nt-cli/src/main.rs CLI entrypoint wiring interactive_clap + tracing verbosity.
nt-cli/src/config.rs Local config persistence + recent-treasury selection helper.
nt-cli/src/api.rs Blocking reqwest API client for Trezu backend endpoints.
nt-cli/src/types.rs Shared request/response and domain types for backend JSON.
nt-cli/src/auth/mod.rs NEP-413 login flow + config token persistence, logout, whoami.
nt-cli/src/treasury/mod.rs Treasury list/info commands and policy display.
nt-cli/src/assets/mod.rs Assets + recent activity commands and formatting helpers.
nt-cli/src/requests/mod.rs Proposal list/view/pending + approve/reject delegate-action flows.
nt-cli/src/payments/mod.rs Payment proposal creation (public transfer + confidential intents path).
nt-cli/src/relay.rs Relay callback that posts signed delegate action to Trezu backend.
nt-cli/src/address_book/mod.rs Address book list/add/remove commands.
nt-cli/src/members/mod.rs Members command (prints roles + members).
nt-cli/Cargo.toml New crate dependencies and features.
.gitignore Ignore target/ at repo root.

Comment thread nt-cli/src/payments/mod.rs
Comment thread nt-cli/src/api.rs
Comment thread nt-cli/src/api.rs
Comment thread nt-cli/src/payments/mod.rs
Comment thread nt-cli/src/payments/mod.rs Outdated
Comment thread nt-cli/src/treasury/mod.rs Outdated
Comment thread nt-cli/src/requests/mod.rs
Comment thread nt-cli/Cargo.toml Outdated
Comment thread nt-cli/Cargo.toml
Copilot AI review requested due to automatic review settings April 16, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 5 comments.

Comment thread nt-cli/src/requests/mod.rs
Comment thread nt-cli/src/api.rs
Comment thread nt-cli/src/requests/mod.rs
Comment thread .github/workflows/cli-release.yml
Comment thread nt-cli/src/config.rs
Copilot AI review requested due to automatic review settings April 17, 2026 13:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 9 comments.

Comment thread nt-cli/src/payments/mod.rs Outdated
Comment thread nt-cli/src/api.rs Outdated
Comment thread nt-cli/src/treasury/mod.rs
Comment thread nt-cli/src/assets/mod.rs
Comment thread nt-cli/src/assets/mod.rs
Comment thread nt-cli/src/requests/mod.rs Outdated
Comment thread nt-cli/src/main.rs
Comment thread nt-cli/src/members/mod.rs
Comment thread nt-cli/src/requests/mod.rs Outdated
@frol frol marked this pull request as ready for review April 17, 2026 16:01
Copilot AI review requested due to automatic review settings April 17, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 12 comments.

Comment thread nt-cli/src/relay.rs
Comment on lines +94 to +95
entry.name,
entry.address,

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this prettytable::row! call, entry.name and entry.address are String fields accessed through &entry. This will attempt to move out of a borrowed value and won’t compile. Pass borrowed values (&entry.name, &entry.address) or clone the strings before building the row.

Suggested change
entry.name,
entry.address,
&entry.name,
&entry.address,

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/cli-release.yml
Comment on lines +68 to +72
- name: Cache dist
uses: actions/upload-artifact@v6
with:
name: cargo-dist-cache
path: ~/.cargo/bin/dist

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file uses actions/upload-artifact@v6 / actions/download-artifact@v7, while other workflows in this repo use @v4. If these major versions aren’t available in your environment, the release pipeline will fail at runtime. Recommend standardizing on the same major versions used elsewhere in the repo unless there’s a specific reason to require newer ones.

Copilot uses AI. Check for mistakes.
Comment thread nt-cli/src/api.rs
Comment thread nt-cli/src/assets/mod.rs
Comment thread .github/workflows/release-plz.yml
Comment thread nt-cli/src/config.rs
Comment thread nt-cli/src/payments/mod.rs
Comment thread nt-cli/src/payments/mod.rs
@frol frol merged commit fcfd0d6 into main Apr 17, 2026
10 checks passed
@frol frol deleted the feat/cli branch April 17, 2026 16:29
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.

2 participants