Post
Share your knowledge.
Why is my Sui CLI not recognizing commands?
*I just installed the Sui CLI to interact with the network, but when I type sui in my terminal, it says “command not found.” Did I mess up the installation, or am I missing something?
- Sui
- Architecture
Answers
6The “command not found” error usually means the Sui CLI isn’t installed correctly or isn’t in your system’s PATH. Reinstall it by following the official guide (https://docs.sui.io/guides/developer/getting-started/cli). Run cargo install --locked --git https://github.com/MystenLabs/sui.git sui to install the CLI. After installation, add it to your PATH by editing your shell configuration (e.g., ~/.bashrc or ~/.zshrc) with export PATH="$HOME/.cargo/bin:$PATH". Verify with sui --version.
It sounds like your Sui CLI installation might not be properly set up, or the installation path might not be added to your system's PATH environment variable. Here's how you can troubleshoot and fix this:
1. Verify Sui CLI Installation
-
First, confirm if Sui CLI is installed correctly by checking the directory where you installed it.
-
If you installed using Homebrew or another package manager, verify if the installation was successful by running:
brew list suiOr for direct installation from the GitHub repository, you can check the location where it was downloaded.
2. Check Your Path Configuration
The error message "command not found" usually means that the system cannot find the sui command in the directories listed in your PATH. This often happens if the directory where the sui CLI is installed is not added to the PATH environment variable.
-
If you installed Sui CLI manually, ensure that the folder containing the
suibinary is added to yourPATH. -
To check if
suiis installed and its location, run:which suiIf this returns nothing, it's not on your
PATH.
Solution:
-
Add Sui CLI to your PATH:
- Find the folder where
suiis located (it’s typically in the installation folder). - Add the folder to your
PATHby editing your shell configuration file (e.g.,~/.bashrc,~/.zshrc, or~/.bash_profiledepending on your shell).
Example for adding to
~/.zshrc(for Zsh users):export PATH="$PATH:/path/to/sui-cli"Replace
/path/to/sui-cliwith the actual folder path where thesuibinary resides. Then, run:source ~/.zshrc # or `source ~/.bashrc` for bash - Find the folder where
3. Reinstall Sui CLI
If the above steps don't resolve the issue, try reinstalling Sui CLI:
- Follow the official installation guide from Sui's documentation for your operating system.
If you're using Homebrew (macOS or Linux), you can install Sui with:
brew install sui
Alternatively, follow the installation instructions from Sui’s GitHub releases to download the latest binaries for your platform.
4. Confirm Installation
After ensuring that the installation is correct and that sui is on your PATH, verify it by running:
sui --version
This should print the installed version of the Sui CLI if it is correctly installed.
5. Check Permissions
-
If you installed it manually and the file has incorrect permissions, ensure the
suibinary is executable:chmod +x /path/to/sui
Conclusion
To resolve the "command not found" issue, make sure the Sui CLI binary is correctly installed and that its location is added to your PATH. If necessary, reinstall the CLI or update your PATH configuration.
Let me know if you need further assistance with any of these steps!
Nah, you probably didn't mess up. It's almost always a PATH issue. When you installed it, the sui executable likely ended up in a directory like ~/.cargo/bin (if you used cargo install) that isn't automatically included in your system's PATH environment variable. You just need to add that directory to your PATH in your shell's config file (like .bashrc, .zshrc, or .profile) and then source it or restart your terminal. A common line to add is export PATH="$HOME/.cargo/bin:$PATH".
If your terminal says “command not found” after you type sui, it likely means your system can't find where the Sui CLI was installed. You probably installed it correctly, but it wasn’t added to your system’s PATH, which tells your computer where to look for command-line tools. To fix this, you need to either move the sui executable to a folder that's already in your PATH (like /usr/local/bin) or update your shell profile (like .bashrc, .zshrc, or .profile) to include the folder where Sui CLI was installed. After doing that, restart your terminal or run source ~/.bashrc (or the relevant profile file) to refresh your session.
Example transaction block (if needed):
export PATH="$HOME/.sui/bin:$PATH"
source ~/.bashrc # or source ~/.zshrc
This should allow your terminal to recognize the sui command.
Do you know the answer?
Please log in and share it.
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- How to Maximize Profit Holding SUI: Sui Staking vs Liquid Staking616
- Why does BCS require exact field order for deserialization when Move structs have named fields?65
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution55
- Sui Move Error - Unable to process transaction No valid gas coins found for the transaction419
- Sui Transaction Failing: Objects Reserved for Another Transaction410