CLI Interface¶
Introduction¶
The CLI interface provides command-line tools for manual short link administration. These tools allow users to perform various operations, such as generating short links, resolving short links, and looking up country information using GeoIP.
Available Commands¶
The following commands are available in the CLI:
Command |
Description |
---|---|
short |
Generate a short link. |
direct |
Generate a direct mirror link. |
resolve |
Resolve a short link to a mirror link. |
geoip |
Look up the country name for an IP address. |
Command: short¶
Generate a short link.
Command Usage:
$ link short <url>
Arguments: - url (required): The URL for which a short link needs to be generated.
Command: direct¶
Generate a direct mirror link.
Command Usage:
$ link direct <url>
Arguments: - url (required): The URL for which a direct mirror link needs to be generated.
Command: resolve¶
Resolve a short link to a mirror link.
Command Usage:
$ link resolve <hash>
Arguments: - hash (required): The hash associated with the short link.
Command: geoip¶
Look up the country name for an IP address.
Command Usage:
$ link geoip <ip>
Arguments: - ip (required): The IP address for which the country name needs to be looked up.
Configuration¶
The CLI interface uses the application’s configuration file to load settings and defaults. See configuration file for more information.
Environment Variables¶
The application supports the following environment variables to configure its behavior:
REDIRECTOR_BASE_URL: The base URL used for generating short links and direct mirror links. If not set, it defaults to http://127.0.0.1:5000/.
REDIRECTOR_API_KEY: The API key used for generating short links and direct mirror links. If not set, it defaults to None.