Skip to main content

UserCommand

Enum UserCommand 

Source
pub enum UserCommand {
Show 13 variants List { discourse: String, listing: String, page: u32, format: ListFormat, }, Info { discourse: String, username: String, format: ListFormat, }, Suspend { discourse: String, username: String, until: String, reason: String, }, Unsuspend { discourse: String, username: String, }, Silence { discourse: String, username: String, until: String, reason: String, }, Unsilence { discourse: String, username: String, }, Promote { discourse: String, username: String, role: RoleArg, }, Demote { discourse: String, username: String, role: RoleArg, }, Create { discourse: String, email: String, username: String, name: Option<String>, password_stdin: bool, approve: bool, }, PasswordReset { discourse: String, username: String, }, EmailSet { discourse: String, username: String, email: String, }, Activity { discourse: String, username: String, since: Option<String>, types: String, limit: Option<u32>, format: ActivityFormatArg, }, Groups { command: UserGroupsCommand, },
}

Variants§

§

List

List users via the admin users endpoint.

Fields

§discourse: String

Discourse name.

§listing: String

Listing type: active | new | staff | suspended | silenced | staged.

§page: u32

Page number (Discourse paginates 100 per page).

§format: ListFormat

Output format.

§

Info

Show detailed info for a user.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§format: ListFormat

Output format.

§

Suspend

Suspend a user.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§until: String

When the suspension ends. ISO-8601 timestamp (e.g. 2026-12-31T00:00:00Z) or forever.

§reason: String

Reason shown to the user and in the audit log.

§

Unsuspend

Remove a suspension from a user.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§

Silence

Silence a user (prevents posting; less visible than suspend).

Fields

§discourse: String

Discourse name.

§username: String

Username.

§until: String

When the silence ends. ISO-8601 timestamp; empty means indefinite.

§reason: String

Reason shown to the user and in the audit log.

§

Unsilence

Lift a silence on a user.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§

Promote

Grant the user the admin or moderator role.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§role: RoleArg

Role to grant.

§

Demote

Revoke the user’s admin or moderator role.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§role: RoleArg

Role to revoke.

§

Create

Create a new user. --approve also marks the account approved (needed when site requires manual approval). Password is either supplied via stdin (--password-stdin) or omitted — in the latter case the user will have to set one via the reset flow.

Fields

§discourse: String

Discourse name.

§email: String

New user’s email address.

§username: String

New user’s username.

§name: Option<String>

Display name (optional).

§password_stdin: bool

Read the password from stdin instead of auto-reset.

§approve: bool

Also mark the user approved (for sites with manual approval).

§

PasswordReset

Trigger Discourse’s password-reset email flow for a user.

Fields

§discourse: String

Discourse name.

§username: String

Username or email.

§

EmailSet

Set a user’s primary email address. Requires admin scope.

Fields

§discourse: String

Discourse name.

§username: String

Username.

§email: String

New email address.

§

Activity

Show a user’s recent public activity (topics + replies by default).

Built for the “archive my own activity to a journal forum” loop — pipe the markdown output straight into dsc topic reply/topic new.

Fields

§discourse: String

Discourse name (the source forum to read activity from).

§username: String

Username whose activity to read.

§since: Option<String>

How far back to look. Accepts 7d, 24h, 30m, 1w, 90s, or an ISO-8601 timestamp / date. Omit to fetch everything available.

§types: String

Action types to include, comma-separated. Default: topics,replies. Also recognises: mentions, quotes, likes, edits, responses.

§limit: Option<u32>

Hard cap on number of items returned.

§format: ActivityFormatArg

Output format.

§

Groups

Manage a user’s group memberships.

Fields

Trait Implementations§

Source§

impl FromArgMatches for UserCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for UserCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more