Skip to main content
==========
Alfred Cmd
==========


.. image:: https://img.shields.io/pypi/v/alfredcmd.svg
:target: https://pypi.python.org/pypi/alfredcmd

.. image:: https://img.shields.io/travis/GustavoKatel/alfredcmd.svg
:target: https://travis-ci.org/GustavoKatel/alfredcmd

.. image:: https://readthedocs.org/projects/alfredcmd/badge/?version=latest
:target: https://alfredcmd.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status




Create portable custom commands and scripts.

This is currently in beta, but usable.

Usage
------

All the config are located in :code:`$USER/.alfred/alfred.toml`

Config
~~~~~~

.. code-block:: toml

[variables]
mode="debug"

[function.branch]
exec="git rev-parse --abbrev-ref HEAD"

[command.st]
exec="git status"

[command.cc]
exec="git commit -a {@}"

[command.push]
exec="git push {@}"

[command.b]
exec="echo {branch()}"

[command.pythonCall]
exec="~/.alfred/myscript.py::myFunction"
type="python"

Run
~~~

.. code-block:: console

$ alfred st
$ al cc


Variables
~~~~~~~~~

Variables are predefined values that can be injected in commands and functions

Example:

.. code-block:: toml

[variables]
mode="debug"

[command.print]
exec="echo {mode}"


Commands
~~~~~~~~

Predefined commands that will be executed by Alfred

Commands are defined like this

.. code-block:: toml

[command.COMMAND_NAME]
exec="EXECUTION_LINE"
type="shell"
format=true
echo=false
help="HELP INFO"

Where:
- **COMMAND_NAME** is the alias that Alfred will use to identify that command in the cli

- **EXECUTION_LINE** is the code that will be called. Alfred accepts multiline entries, which
will be wrapped in a script file and executed with the default shell executor.

- **type** the type of the command. Alfred currently accepts `shell` and `python` command types

- **format** marks if the instance should apply the formatter in the exec line or not.
If false, the placeholders `{}` will not be interpreted

- **echo** marks if the instance should print the command that will be executed before executing it

- **help** a descriptive message that will be showed in `alfred @list`

Functions
~~~~~~~~~

Functions can be created to enhance command execution during format time and are defined like this:

.. code-block:: toml

[function.FUNCTION_NAME]
exec="EXECUTION_LINE"
format=true

Where:

- **FUNCTION_NAME** is the alias that Alfred will use to identify that function in the formatter

- **EXECUTION_LINE** is the code that will be called. Currently Alfred only accepts one-line shell commands in functions.

- **format** marks if the instance should apply the formatter in the exec line or not.
If false, the placeholders `{}` will not be interpreted


Built-in Alfred commands
~~~~~~~~~~~~~~~~~~~~~~~~

- `al[fred] @help` Show help
- `al[fred] @list` List all commands
- `al[fred] @version` Show version

Installation
------------

Stable release
~~~~~~~~~~~~~~

To install Alfred, run this command in your terminal:

.. code-block:: console

$ pip install alfredcmd

This is the preferred method to install Alfred, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/


From sources
~~~~~~~~~~~~~

The sources for Alfred can be downloaded from the `Github repo`_.

You can either clone the public repository:

.. code-block:: console

$ git clone git://github.com/GustavoKatel/alfredcmd

Or download the `tarball`_:

.. code-block:: console

$ curl -OL https://github.com/GustavoKatel/alfredcmd/tarball/master

Once you have a copy of the source, you can install it with:

.. code-block:: console

$ python setup.py install


.. _Github repo: https://github.com/GustavoKatel/alfredcmd
.. _tarball: https://github.com/GustavoKatel/alfredcmd/tarball/master


Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2018-03-21)
------------------

* First release on PyPI.


Metadata

Release files for alfredcmd 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alfredcmd 0.1.7
File Size Uploaded
alfredcmd-0.1.7.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alfredcmd 0.1.7
File Interpreter ABI Platform
alfredcmd-0.1.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 22.6 kB

Release files / alfredcmd-0.1.7.tar.gz

Download URL alfredcmd-0.1.7.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f10acff56393b1dddc076e988b1f7f7b0d323dda3f750942d7d823a00a864795
BLAKE2b-256 checksum
How to use checksums
059337294321696bcb09edca527a6e09de45fccf2fac4bb66478ca7465eb1cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / alfredcmd-0.1.7-py2.py3-none-any.whl

Download URL alfredcmd-0.1.7-py2.py3-none-any.whl
Size 8.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c954ff0b45b0a151fe12c175780ddc770fda146eced966b3644f834c3291fd4e
BLAKE2b-256 checksum
How to use checksums
4376a0dd59ad793cb9e6a680953b5c91ddba484af73b6b13a6d91921ae9e4aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page