Sigil documentation
ReferenceRust referencesigil-wallet

sigil-wallet · cli

Source declarations, signatures and documentation for cli.

Source: sigil/node/sigil-wallet/src/cli.rs. SHA-256: da6cb74804ef0319bf031fdac7fe4f4fbbe315f84a843d5c095cad1f9fca4a38.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

cli::Cli

Sigil Wallet -- manage identities, transfer tokens, stake, and govern.

The Sigil wallet is how agents interact with the Sigil blockchain. Create identities, manage keys, transfer MINT coins, stake as a validator, and participate in on-chain governance.

Examples: sigil-wallet identity create --namespace sigil --name alice --kind hmr sigil-wallet balance sigil-wallet transfer --to did:oas:sigil:agent:bob --amount 1000000 sigil-wallet stake deposit --amount 10000000000 --mode producer sigil-wallet username register --name alice --years 1 --set-primary sigil-wallet gov propose --title "Raise gas" --description "Let us raise the limit"

#[derive(Debug, Clone, Parser)]
#[command(
    name = "sigil-wallet",
    version,
    about = "Sigil blockchain wallet for agent identity, transfers, staking, and governance",
    long_about = None,
    after_help = "For more information, visit https://docs.sigil.ml/wallet"
)]
pub struct Cli {
/// Subcommand to execute.

#[command(subcommand)]
pub command: Commands,
/// RPC endpoint URL for the Sigil node.

#[arg(long, global = true, env = "SIGIL_RPC_URL")]
pub rpc_url: Option<String>,
/// Chain ID to target.

#[arg(long, global = true, env = "SIGIL_CHAIN_ID")]
pub chain_id: Option<String>
}

Source line: 26.

cli::Commands

Top-level command groups.

#[derive(Debug, Clone, Subcommand)]
pub enum Commands {
    /// Manage identities (create, derive, list, show, export, import).
    Identity {
        #[command(subcommand)]
        cmd: IdentityCommands,
    },

    /// Query account balance.
    ///
    /// Examples:
    ///   sigil-wallet balance
    ///   sigil-wallet balance --did did:oas:sigil:hmr:alice
    Balance {
        /// DID to check (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Transfer MINT to another account.
    ///
    /// Examples:
    ///   sigil-wallet transfer --to did:oas:sigil:agent:bob --amount 1000000
    ///   sigil-wallet transfer --from did:oas:sigil:hmr:alice --to did:oas:sigil:agent:bob --amount 5000000 --memo "payment"
    Transfer {
        /// Recipient DID.
        #[arg(long)]
        to: String,
        /// Amount in micro-MINT.
        #[arg(long)]
        amount: u64,
        /// Sender DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
        /// Optional memo attached to the transfer.
        #[arg(long)]
        memo: Option<String>,
    },

    /// View transaction history.
    History {
        /// DID to query (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
        /// Maximum number of transactions to show.
        #[arg(long, default_value_t = 20)]
        limit: u32,
    },

    /// Staking operations.
    ///
    /// Examples:
    ///   sigil-wallet stake deposit --amount 10000000000 --mode producer
    ///   sigil-wallet stake withdraw --amount 5000000000
    ///   sigil-wallet stake delegate --to did:oas:sigil:agent:v1 --amount 1000000000
    ///   sigil-wallet stake rewards
    Stake {
        #[command(subcommand)]
        cmd: StakeCommands,
    },

    /// Username registry operations.
    ///
    /// Examples:
    ///   sigil-wallet username register --name alice --years 1 --set-primary
    ///   sigil-wallet username set-primary --name alice
    ///   sigil-wallet username show --name alice
    Username {
        #[command(subcommand)]
        cmd: UsernameCommands,
    },

    /// Governance operations.
    ///
    /// Examples:
    ///   sigil-wallet gov propose --title "Raise gas limit" --description "Proposal to increase gas"
    ///   sigil-wallet gov vote --proposal prop-001 --vote yes
    ///   sigil-wallet gov list
    ///   sigil-wallet gov show prop-001
    Gov {
        #[command(subcommand)]
        cmd: GovCommands,
    },

    /// Agent Contract Zone operations.
    ///
    /// Examples:
    ///   sigil-wallet contract register-code --code ./token.wasm --license Apache-2.0
    ///   sigil-wallet contract deploy --contract-did did:oas:sigil:contract:token --code-hash <hash>
    Contract {
        #[command(subcommand)]
        cmd: ContractCommands,
    },

    /// Wallet configuration.
    ///
    /// Examples:
    ///   sigil-wallet config set --rpc http://localhost:12618
    ///   sigil-wallet config set --chain-id sigil-testnet-1
    ///   sigil-wallet config set --default-identity did:oas:sigil:hmr:alice
    ///   sigil-wallet config show
    Config {
        #[command(subcommand)]
        cmd: ConfigCommands,
    },

    /// Query Sigil node status.
    ///
    /// Examples:
    ///   sigil-wallet node status
    ///   sigil-wallet node info
    Node {
        #[command(subcommand)]
        cmd: NodeCommands,
    },
}

Source line: 42.

cli::IdentityCommands

Identity management subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum IdentityCommands {
    /// Create a new identity with a fresh Ed25519 keypair.
    ///
    /// Examples:
    ///   sigil-wallet identity create --namespace sigil --name alice --kind hmr
    ///   sigil-wallet identity create --namespace sigil --name l1fe-labs --kind enr
    ///   sigil-wallet identity create --namespace sigil --name my-bot --kind agent
    Create {
        /// Namespace for the DID (e.g. "sigil").
        #[arg(long)]
        namespace: String,
        /// Name / identifier within the namespace.
        #[arg(long)]
        name: String,
        /// Identity kind: "hmr", "mhr", "enr", or "agent".
        #[arg(long, default_value = "hmr")]
        kind: String,
    },

    /// Derive a child identity from an existing parent.
    ///
    /// Examples:
    ///   sigil-wallet identity derive --parent did:oas:sigil:hmr:alice --name bot-1 --kind agent
    Derive {
        /// Parent DID to derive from.
        #[arg(long)]
        parent: String,
        /// Name for the child identity.
        #[arg(long)]
        name: String,
        /// Kind of child identity: "hmr", "mhr", "enr", or "agent".
        #[arg(long, default_value = "agent")]
        kind: String,
    },

    /// List all identities in the local keystore.
    List,

    /// Show details of a specific identity.
    Show {
        /// DID of the identity to show.
        did: String,
    },

    /// Export an identity to a file (encrypted keystore format).
    Export {
        /// DID of the identity to export.
        did: String,
        /// Output file path.
        #[arg(long, short)]
        output: String,
    },

    /// Import an identity from an exported file.
    Import {
        /// Path to the keystore file to import.
        file: String,
    },
}

Source line: 160.

cli::StakeCommands

Staking subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum StakeCommands {
    /// Deposit stake to become a validator.
    ///
    /// Examples:
    ///   sigil-wallet stake deposit --amount 10000000000 --mode producer
    ///   sigil-wallet stake deposit --amount 1000000000 --mode validator --did did:oas:sigil:agent:v1
    Deposit {
        /// Amount in micro-MINT.
        #[arg(long)]
        amount: u64,
        /// Validator mode: "producer" or "validator".
        #[arg(long)]
        mode: String,
        /// Identity DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Withdraw staked tokens (begins unbonding period).
    Withdraw {
        /// Amount in micro-MINT.
        #[arg(long)]
        amount: u64,
        /// Identity DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Delegate stake to a validator.
    Delegate {
        /// Validator DID to delegate to.
        #[arg(long)]
        to: String,
        /// Amount in micro-MINT.
        #[arg(long)]
        amount: u64,
        /// Delegator identity DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// View accumulated staking rewards.
    Rewards {
        /// Identity DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Show staking information for an identity.
    Info {
        /// Identity DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },
}

Source line: 222.

cli::UsernameCommands

Username registry subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum UsernameCommands {
    /// Register a username by paying the chain-defined lease price.
    Register {
        /// Username to register. The chain canonicalizes ASCII case.
        #[arg(long)]
        name: String,
        /// Lease duration in years.
        #[arg(long, default_value_t = 1)]
        years: u32,
        /// Owner DID (defaults to configured identity).
        #[arg(long)]
        owner: Option<String>,
        /// Optional 32-byte metadata content hash as hex or blake3:<hex>.
        #[arg(long)]
        metadata_cid: Option<String>,
        /// Submit a follow-up SetReverseUsername transaction after registration.
        #[arg(long)]
        set_primary: bool,
    },

    /// Set a username as the primary reverse lookup for a DID.
    SetPrimary {
        /// Username to use as primary.
        #[arg(long)]
        name: String,
        /// Owner DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Transfer a username to another DID.
    Transfer {
        /// Username to transfer.
        #[arg(long)]
        name: String,
        /// New owner DID.
        #[arg(long)]
        to: String,
        /// Current owner DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
    },

    /// Release a username.
    Release {
        /// Username to release.
        #[arg(long)]
        name: String,
        /// Current owner DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
    },

    /// Set or clear username metadata content hash.
    SetMetadata {
        /// Username to update.
        #[arg(long)]
        name: String,
        /// Optional 32-byte metadata content hash as hex or blake3:<hex>. Omit with --clear.
        #[arg(long)]
        metadata_cid: Option<String>,
        /// Clear existing metadata.
        #[arg(long)]
        clear: bool,
        /// Owner DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
    },

    /// Resolve a username record.
    Show {
        /// Username to resolve.
        #[arg(long)]
        name: String,
    },

    /// List usernames owned by a DID.
    List {
        /// Owner DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },
}

Source line: 280.

cli::GovCommands

Governance subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum GovCommands {
    /// Submit a governance proposal.
    Propose {
        /// Proposal title.
        #[arg(long)]
        title: String,
        /// Proposal description.
        #[arg(long)]
        description: String,
        /// Proposer DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// Vote on a governance proposal.
    Vote {
        /// Proposal ID.
        #[arg(long)]
        proposal: String,
        /// Vote choice: yes, no, abstain, no_with_veto.
        #[arg(long = "vote")]
        choice: String,
        /// Voter DID (defaults to configured identity).
        #[arg(long)]
        did: Option<String>,
    },

    /// List governance proposals.
    List {
        /// Filter by status: active, passed, rejected.
        #[arg(long)]
        status: Option<String>,
    },

    /// Show details of a specific proposal.
    Show {
        /// Proposal ID.
        id: String,
    },
}

Source line: 366.

cli::ContractCommands

Smart-contract deployment subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum ContractCommands {
    /// Register WASM bytecode by content hash before deployment.
    RegisterCode {
        /// Path to a WASM bytecode file.
        #[arg(long)]
        code: String,
        /// SPDX license expression or governance-approved license label.
        #[arg(long)]
        license: String,
        /// Optional source artifact URI.
        #[arg(long)]
        source_uri: Option<String>,
        /// Optional BLAKE3/Sigil hash of the source artifact.
        #[arg(long)]
        source_hash: Option<String>,
        /// Optional audit report URI.
        #[arg(long)]
        audit_uri: Option<String>,
        /// Optional JSON object string for extra deterministic metadata.
        #[arg(long)]
        metadata_json: Option<String>,
        /// Sender/controller DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
    },

    /// Deploy a contract from previously registered bytecode.
    Deploy {
        /// Contract DID to create.
        #[arg(long)]
        contract_did: String,
        /// Hex or `blake3:<hex>` code hash registered on-chain.
        #[arg(long)]
        code_hash: String,
        /// Optional Organization Zone ID.
        #[arg(long)]
        zone_id: Option<String>,
        /// Sender/controller DID (defaults to configured identity).
        #[arg(long)]
        from: Option<String>,
    },
}

Source line: 409.

cli::ConfigCommands

Configuration subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum ConfigCommands {
    /// Set a configuration value.
    Set {
        /// RPC endpoint URL.
        #[arg(long)]
        rpc: Option<String>,
        /// Chain ID.
        #[arg(long)]
        chain_id: Option<String>,
        /// Default identity DID.
        #[arg(long)]
        default_identity: Option<String>,
    },

    /// Show current configuration.
    Show,
}

Source line: 454.

cli::NodeCommands

Node query subcommands.

#[derive(Debug, Clone, Subcommand)]
pub enum NodeCommands {
    /// Show the sync status of the connected node.
    Status,

    /// Show node information (version, chain ID).
    Info,
}

Source line: 474.

On this page