Here’s an improved, detailed, and structured version of your CLI documentation for the chat application, with code examples for better clarity:
Welcome to the chat application! This documentation will guide you through the various CLI commands available to interact with the platform. Commands are categorized for ease of use.
- User Management
- Register
- Login
- Logout
- Update Username
- Update Password
- Delete User
- User Interaction
- Search Users
- Send Direct Messages
- View Direct Messages
- Server Management
- Create Server
- Join Server
- Leave Server
- Invite Members
- Manage Categories and Channels
- Role Management
- Messaging
- Send Messages
- Display Messages
Create a new user with the register
command.
Command:
register --username <username> --password <password>
Example:
register --username alice123 --password secretpass
Log in with your username and password.
Command:
login --username <username> --password <password>
**Example:**
```bash
login --username alice123 --password secretpass
Log out of your current session.
Command:
logout
Example:
logout
Change your username.
Command:
update-username <new_username> <current_password>
Example:
update-username alice_updated secretpass
Change your password.
Command:
update-password <new_password> <current_password>
Example:
update-password newsecretpass secretpass
Permanently delete your account and all associated data.
Command:
delete-user
Example:
delete-user
Find other users on the platform. Returns up to 5 results.
Command:
search-users <search_term>
Example:
search-users alice
Send a private message to another user.
Command:
send-dm <user_name>
Example:
send-dm bob123
You will be prompted to type your message after running the command.
View received direct messages.
Command:
display-dms
View messages you have sent.
Command:
display-sent-dms
Set up a new server.
Command:
create-server --name <server_name> --permission <join_permission>
Example:
create-server --name myServer --permission closed
join_permission
can be open
(anyone can join) or closed
(invite only). Default is open
.
Use kickout-member --server <server_name> --member <user_name>
to kickout a member from a server. Note that you must be an owner or moderator for this.
Use kickout-member server_name user_name
to kickout a member from a server. Note that you must be an owner/moderator for this.
Use create-invite-code server_name
to create an invite code for a server. Note that you must be an owner/moderator for this.
Use join-server-with-code invite_code
to join a server with an invite code.
Join an existing server.
Command:
join-server --server <server_name>
Example:
join-server --server myServer
Leave a server you are part of.
Command:
leave-server --server <server_name>
Example:
leave-server --server myServer
If you are the server owner, transfer ownership first.
Invite users to your server (owner only).
Command:
add-member --server <server_name> --member <user_name>
Example:
add-member --server myServer --member charlie123
-
Add a Category:
add-category --server <server_name> --category <category_name>
Example:
add-category --server myServer --category general
-
Add a Channel:
add-channel --server <server_name> --channel <channel_name> --permissions <channel_perms> --type <channel_type> --category <parent_category>
Example:
add-channel --server myServer --channel text-chat --permissions member --type text --category general
-
Create a Role:
create-role --server <server_name> --role <role_name> --permission <role_permission>
Example:
create-role --server myServer --role moderator --permission moderator
-
Assign a Role:
assign-role --server <server_name> --role <role_name> --member <member_name>
Example:
assign-role --server myServer --role moderator --member charlie123
Send a message in a text channel.
Command:
send-msg --server <server_name> --channel <channel_name>
Example:
send-msg --server myServer --channel text-chat
You will be prompted to type your message after running the command.
View all messages in a channel.
Command:
display-messages --server <server_name> --channel <channel_name>
Example:
display-messages --server myServer --channel text-chat
Use send-dm --recipient username --message "your message"
to send a direct message to a user.
Use display-dms
with the --filter
flag to view your messages:
display-dms --filter received
to see received messagesdisplay-dms --filter sent
to see sent messagesdisplay-dms --filter all
or justdisplay-dms
to see all messages
Use delete-user --confirm yes
to delete your user account permanently.
Note: You must be logged in to use these commands.