Package: lnkshrt-cli
lnkshrt-clilnkshrt-cliis a command-line application that allows you to easily generate shortened URLs, authenticate with your lnkshrt account, delete links, and perform other actions from the command line. It provides a convenient and efficient way of interfacing with thelnkshrtlink shortening API hosted atlnkshrt.xyzTable of ContentsFeaturesInstallationQuick StartUsageDevelopmentLicenseFeaturesGenerate shortened URLs for quick and easy sharing.Delete existing links when they are no longer needed.Easily authenticate with the API.Generate QR codes for the shortened URLs.By default, the CLI app interacts with thelnkshrtAPI instance hosted atlnkshrt.xyz. However, if you prefer to use a differentlnkshrtAPI instance, you have the flexibility to set a custom instance using thelnkshrt config --instance-urlcommand. This is particularly useful fordevelopment purposes.For more information about thelnkshrtAPI itself, see theAPI repository.InstallationYou can installlnkshrt-cliusing pip orpipx(recommended):Installation with pippipinstalllnkshrtInstallation with pipx (recommended)Alternatively, if you prefer to install the package in an isolated environment, use pipx:pipxinstalllnkshrtQuick StartCreate an account:lnkshrtcreate--username<your_username>--email<valid_email>Once you have created an account, you can authenticate with lnkshrt-cli using the following command:lnkshrtlogin--username<your_username>This will prompt you to enter your lnkshrt account credentials and generate an authentication token for API access. The token will be saved and used for subsequent API requests.To generate a shortened URL:lnkshrtcreate<urlyouwanttoshorten>To delete a previously created link, you can use the lnkshrt delete command followed by the shortened URL:lnkshrtdelete<short_url>Replace<short_url>with the shortened URL you intend to delete.For more information on available commands and options, you can use the built-in help:lnkshrt--helpUsage$lnkshrt[OPTIONS]COMMAND[ARGS]...Options:--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.Commands:config: Configure lnkshrt settings.create: Create a shortened URL.delete: Delete a shortened URL.login: Authenticate with an existing user account.signup: Create a new user account.lnkshrt configConfigure lnkshrt settings.This command provides a convenient way to set and modify lnkshrt settings.
The settings are stored in a configuration file namedsettings.toml.
This command is the recommended way of modifying this file.Usage:$lnkshrtconfig[OPTIONS]Options:--instance-url TEXT: The URL of the instance to use for shortening links.If invoked without any value, the instance URL will be reset to the default.--token TEXT: Set the authentication token to be used for API access.--help: Show this message and exit.lnkshrt createCreate a shortened URL.Usage:$lnkshrtcreate[OPTIONS]URLArguments:URL: The original URL to be shortened.  [required]Options:--custom-path TEXT: Specify a custom path for the shortened URL.--generate-qr-code TEXT: If provided, generate a QR code for the shortened URLThe generated QR code image will be saved to the specified location.--help: Show this message and exit.lnkshrt deleteDelete a shortened URL.Usage:$lnkshrtdelete[OPTIONS]URLArguments:URL: The original URL to be shortened.  [required]Options:--help: Show this message and exit.lnkshrt loginAuthenticate with an existing user account.Upon successful authentication, an authentication token will be
generated and stored for future API requests.
Accounts can be created using thelnkshrt signupcommand.Usage:$lnkshrtlogin[OPTIONS]Options:--username TEXT: [required]--password TEXT: Your password. If not provided, you will be prompted to enter it. [required]--help: Show this message and exit.lnkshrt signupCreate a new user account.Usage:$lnkshrtsignup[OPTIONS]Options:--username TEXT: [required]--email TEXT: [required]--password TEXT: Your password. If not provided, you will be prompted to enter it.  [required]--help: Show this message and exit.DevelopmentClone the repository and navigate to the project directory:gitclonehttps://github.com/vivekashok1221/lnkshrt-cli.gitcdlnkshrt-cliSet up poetry envAssuming you havepoetry installed, install the dependencies by running:poetryinstallTo activate the poetry venv:poetryshellSet Up Pre-commit Hookspoetryruntaskprecommitpre-commithelps ensure code quality and consistency by automatically running various checks and formatting tools on your code before each commit.LintingTo manually run the linting checks:poetryruntasklintIf you want to use a locally running instance of the API:Set uplnkshrtAPI by following the guide in the"Getting Started"section of the API repository.Set the instance URL tohttp://0.0.0.0:8000by running the following command:lnkshrtconfig--instance-urlhttp://0.0.0.0:8000LicenseThis project is licensed under the MIT License.