pkm
has been designed to be simple and extremely user friendly so its commands are mostly self-explanatory. Following are their uses and descriptions
- Run the command
curl -L https://raw.githubusercontent.com/Hammad-hab/pkm/main/install.py >> install.py
- This will create a file named
install.py
in the current directory - After the file has been installed, run
install.py
. The script will automatically install pkm into your system
To check if pkm
has been installed correctly, run pkm info
. If you encounter an error, please report it at issues
tab.
Used for installing a package.
Syntax:
pkm install <package_name> [--disable-logs| --no-disable-logs | --pack | --no-log]
Attributes:
--disable-logs
: Silence thepkm
installer logs. This means that no success or info logs will be shown, only errors--no-disable-logs
(default): This is the default value of the en-logs configuration i.e logs are not disabled
--pack
(default): Mojo has an amazing ability to compile its packages into a .📦 (.mojopkg
). The--pack
ensures that the installed package is compiled into a .📦--no-pack
: Like its name suggests, it preventspkm
from usingmojo package
to compile the package into a .📦
Used for purging (removing/uninstalling) a package.
Syntax:
pkm purge <package_name> [--disable-logs| --no-disable-logs]
Attributes:
--disable-logs
: Silence thepkm
installer logs. This means that no success or info logs will be shown, only errors--no-disable-logs
(default): This is the default value of the en-logs configuration i.e logs are not disabled
--force
: Forcefully delete a package without any confirmation prompts.
Used to check if a pkm
package has been installed
Syntax:
pkm has <package_name>
Used to print the default configuration of pkm
(deprecated)
Updates the local package list
Syntax:
pkm update
Detailed Explanation
pkm
downloads packages from different places so in order to ensure minimal server interaction, pkm
like apt
/apt-get
maintains a sources.list
which contains all the packages and their locations.
If the original repository has a new package, pkm
won't know until the sources.list
is updated.
Upload a package to the pkm
repository
Syntax:
pkm upload [--record_creds| --no-record-creds | --ignore-stored | --no-ignore-stored]
Attributes:
--record-creds
(True
/False
): specify if you want to prevent pkm from storing your credentials to prevent you from having to login every time you upload a package--ignore-stored
(True
/False
): specify if forcefully want pkm to ignore record credentials. This is useful if you want to login again.
Used to create a repository account/package
Syntax:
pkm create <account || package>
pkm create account
Create an account. It prompts you for the username and password for your registration. Options:
--autologin
(default=False
): Automatically login as soon as you create the account
pkm create package
Initialize an empty package with ease. When this command runs it prompts you for the package name, version et cetera.
It will create a ./src
directory, a README.md
, package.toml
and a main.🔥
file.
Delete pkm
from your system
Options:
--force
: Forcefully delete a pkm
without any confirmation prompts.
--silent
: Disable all kind of logs (error's are still shown).
Get info regarding your pkm
copy, usually it's location, version etc.
List all the available packages in the pkm repository
Options:
--gui
: Tells pkm to list the packages in a GUI instead of the terminal
You can double click any item on the list to copy it (GUI only).
To upload a package you can use pkm upload
command built into pkm
. Following are the steps you should generally follow in order to upload a package:
- Upload your package to github in any way you choose
- Run
pkm upload
- The cli will prompt you for your login details and package information
- Type in your username and password if you have an account. If you do not have an account, you can create one by running
pkm create account
(See above for usage) - If you have created a package using
pkm create package
the cli will automatically fetch information regarding it and upload the package, if not then it'll prompt you for package name, repository et cetera. - Press [
ENTER
] to upload the package to the repository