Skip to content

Commit a1a71df

Browse files
authored
Merge branch 'main' into add-cypress-workflow
2 parents abad350 + 0481ca7 commit a1a71df

57 files changed

Lines changed: 739 additions & 10 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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 rustup
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.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Tap a Homebrew formula repository from GitHub
3+
command: "brew tap {{formula_repository}}"
4+
tags:
5+
- homebrew
6+
description: Taps a Homebrew formula repository (a repository that contains Homebrew formulae) from GitHub.
7+
arguments:
8+
- name: tap_repository
9+
description: The repository to tap (in format of "username/repo")
10+
default_value: ~
11+
source_url: "https://docs.brew.sh/Manpage"
12+
author: Wyatt-Stanke
13+
author_url: "https://github.com/Wyatt-Stanke"
14+
shells: []
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: List all installed Homebrew formulae/casks
3+
command: "brew list"
4+
tags:
5+
- homebrew
6+
description: Lists all installed Homebrew formulae/casks
7+
source_url: "https://docs.brew.sh/Manpage"
8+
author: Wyatt-Stanke
9+
author_url: "https://github.com/Wyatt-Stanke"
10+
shells: []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Pin a formula to its current version
3+
command: "brew pin {{formula_name}}"
4+
tags:
5+
- homebrew
6+
description: Pins a version of a homebrew formula to its current version, i.e. it will not be updated when a newer version is available.
7+
arguments:
8+
- name: formula_name
9+
description: The formula to pin
10+
default_value: ~
11+
source_url: "https://docs.brew.sh/Manpage"
12+
author: Wyatt-Stanke
13+
author_url: "https://github.com/Wyatt-Stanke"
14+
shells: []
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Reinstall all installed Homebrew formulae/casks
3+
command: "brew list -1 | xargs brew reinstall"
4+
tags:
5+
- homebrew
6+
description: Reinstalls all installed Homebrew formulae and casks
7+
source_url: "https://docs.brew.sh/Manpage"
8+
author: Wyatt-Stanke
9+
author_url: "https://github.com/Wyatt-Stanke"
10+
shells: []

specs/brew/reinstall_formula.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Reinstall a Homebrew formula
3+
command: "brew reinstall {{formula_name}}"
4+
tags:
5+
- homebrew
6+
arguments:
7+
- name: formula_name
8+
description: The formula to reinstall
9+
default_value: ~
10+
description: Reinstall a Homebrew formula
11+
source_url: "https://docs.brew.sh/Manpage"
12+
author: Wyatt-Stanke
13+
author_url: "https://github.com/Wyatt-Stanke"
14+
shells: []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Unpin a homebrew formula
3+
command: "brew unpin {{formula_name}}"
4+
tags:
5+
- homebrew
6+
description: Unpins a version of a homebrew formula to its current version, i.e. it will not be updated when a newer version is available.
7+
arguments:
8+
- name: formula_name
9+
description: The formula to unpin
10+
default_value: ~
11+
source_url: "https://docs.brew.sh/Manpage"
12+
author: Wyatt-Stanke
13+
author_url: "https://github.com/Wyatt-Stanke"
14+
shells: []

specs/file_manipulation/recursively_find_and_replace_within_a_directory.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Recursively find and replace within a directory
3-
command: "grep -rl {{old_text}} {{file_path}} | xargs sed -i 's/{{old_text}}/{{new_text}}/g'"
3+
command: "grep -rl {{old_text}} {{file_path}} | xargs sed -i '' 's/{{old_text}}/{{new_text}}/g'"
44
tags:
55
- file manipulation
66
- sed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Configure your current NativeScript project to target the selected platform.
2+
command: "ns platform add {{platform}}"
3+
tags:
4+
- nativescript
5+
description: "Configures the current NativeScript project to target the selected platform. When you add a target platform, the NativeScript CLI creates a corresponding platform-specific subdirectory under the platforms directory. This platform-specific directory contains the necessary files to let you build your project for the target platform."
6+
arguments:
7+
- name: platform
8+
description: The name of the platform. E.g. ios, android, etc.
9+
source_url: "https://github.com/NativeScript/nativescript-cli/blob/master/docs/man_pages/project/configuration/platform-add.md"
10+
author: erodriguezh
11+
author_url: "https://github.com/erodriguezh"
12+
shells: []
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Build your NativeScript project for Android or iOS.
2+
command: "ns build {{platform}}"
3+
tags:
4+
- nativescript
5+
description: "Builds your NativeScript project for Android or iOS and produces an application package that you can manually deploy on a device or native emulator."
6+
arguments:
7+
- name: platform
8+
description: The name of the platform. E.g. ios, android, etc.
9+
source_url: "https://github.com/NativeScript/nativescript-cli/blob/master/docs/man_pages/project/testing/build.md"
10+
author: erodriguezh
11+
author_url: "https://github.com/erodriguezh"
12+
shells: []

0 commit comments

Comments
 (0)