Skip to content

Commit 2b3d9b3

Browse files
authored
Merge pull request #55 from warpdotdev/aloke/better_readme
Add a more informational README
2 parents 64834a5 + 1269631 commit 2b3d9b3

1 file changed

Lines changed: 80 additions & 5 deletions

File tree

README.md

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,94 @@
11
# Workflows
22

3-
The repo for Workflows that appear within Warp and within [commands.dev](https://www.commands.dev/)
3+
The repo for all _public_ Workflows that appear within Warp and within [commands.dev](https://www.commands.dev/).
4+
5+
**To learn how to create local or repository workflows, see [our docs](https://github.com/warpdotdev/warp-internal/pull/2205).**
6+
7+
<img width="736" alt="image" src="https://user-images.githubusercontent.com/4110292/164031239-49f0ec9e-f124-44c4-89e6-6facc9bf9a8f.png">
8+
49

510
## What are Workflows?
611

712
Workflows are an easier way to execute and share commands within Warp. They are searchable by name, description, or command and are easily parameterized. See our documentation for more details: [https://docs.warp.dev/features/workflows](https://docs.warp.dev/features/workflows)
813

9-
## How Do I Access Workflows?
14+
## How Do I Access Workflows within Warp?
1015

11-
Workflows can be accessed within Warp directly within the app, either through the Command Palette or by pressing `ctrl-shift-r`.
16+
Workflows can be accessed directly within Warp, either through the Command Palette or by pressing `ctrl-shift-r`.
1217

1318
All public workflows (i.e. workflows within this repo) are also available at [commands.dev](https://www.commands.dev/).
1419

1520
## Contributing
16-
1721
Contributions are always welcome! If you have a workflow that would be useful to many Warp users, feel free to send a PR to add a Workflow spec.
1822

19-
The existing preset files should serve as an example for the format, while the a more comprehensive description of the file format is available in [FORMAT.md](FORMAT.md). Please request a review from someone on the Warp team once a PR is ready for review.
23+
All workflows are defined as YAML files within the [`specs/`](specs/) directory.
24+
25+
### File Format
26+
A comprehensive description of the file format is available in [FORMAT.md](FORMAT.md).
27+
Additionally, see the workflow below as an example to quickly get started:
28+
29+
```yaml
30+
---
31+
# The name of the workflow.
32+
name: Uninstall a Homebrew package and all of its dependencies
33+
# The corresponding command for the workflow. Any arguments should be surrounded with two curly braces. E.g `command {{arg}}`.
34+
command: |-
35+
brew tap beeftornado/rmtree
36+
brew rmtree {{package_name}}
37+
# Any tags that the workflow should be categorized with.
38+
tags:
39+
- homebrew
40+
# A description of the workflow.
41+
description: Uses the external command rmtree to remove a Homebrew package and all of its dependencies
42+
# List of arguments within the command.
43+
arguments:
44+
# Name of the argument within the command. This must exactly match the name of the argument
45+
# within the command (without the curly braces).
46+
- name: package_name
47+
# The description of the argument.
48+
description: The name of the package that should be removed
49+
# The default value for the argument.
50+
default_value: ~
51+
# The source URL for where the workflow was generated from, if any.
52+
source_url: "https://stackoverflow.com/questions/7323261/uninstall-remove-a-homebrew-package-including-all-its-dependencies"
53+
# The author of the workflow.
54+
author: Ory Band
55+
# The URL of original author of the Workflow. For example, if this workflow was generated from StackOverflow, the `author_url` would be the StackOverflow author's profile page.
56+
author_url: "https://stackoverflow.com/users/207894"
57+
# The valid shells where this workflow should be active. If valid for all shells, this can be left empty.
58+
# See FORMAT.md for the full list of accepted values.
59+
shells: []
60+
```
61+
62+
### Testing
63+
To test a workflow within Warp before submitting, you can use it as a local workflow within warp.
64+
65+
To do this:
66+
1) Copy the workflow to your local `~/.warp/workflows` directory:
67+
```bash
68+
mkdir -p ~/.warp/workflows && cp {{workflow}}.yaml; ~/.warp/workflows/
69+
```
70+
2) Open Warp and open workflows by pressing `ctrl-shift-r` or using the command palette.
71+
3) Click on "My Workflows" on the left to filter for local workflows.
72+
![README md — workflows 2022-04-19 at 11 52 53 AM](https://user-images.githubusercontent.com/4110292/164045025-8eb3dd66-260a-4b12-8a4b-beae563db8ee.jpg)
73+
4) Click on the workflow you've added and ensure all the information is correct.
74+
75+
To quickly test if a workflow file format is valid, you can also build workflows locally to validate the schema is correct:
76+
```
77+
# Download the rust toolchain, if not already installed.
78+
brew install rust-up
79+
rustup-init
80+
81+
# Ensure the workflows can successfully be converted into Rust.
82+
cargo build
83+
```
84+
85+
86+
### What Makes a Useful Workflow?
87+
A good workflow is one that includes a command with many flags or arguments or one that is hard to remember.
88+
89+
Additionally, a workflow _must_ include:
90+
91+
* A descriptive title that includes the name of the command--this is useful for improving the experience of searching for workflows in Warp or [commands.dev](https://www.commands.dev/).
92+
* A tag that accurately categorizes the workflows. Avoid many repetitive tags to improve searchability of workflows within Warp.
93+
* A description for the workflow and each of its arguments, if applicable.
94+
* A default value for each argument, if applicable.

0 commit comments

Comments
 (0)