poly
Search…
Commands
The individual help texts listed here are taken from the built-in help command.
Commands
To list all available commands, type:
1
poly help
Copied!
1
Poly 0.2.13-alpha (2021-09-10) - https://github.com/polyfy/polylith
2
3
poly CMD [ARGS] - where CMD [ARGS] are:
4
5
check Checks if the workspace is valid.
6
create E name:N [ARG] Creates a component, base, project or workspace.
7
deps [project:P] [brick:B] Shows dependencies.
8
diff Shows changed files since last stable point in time.
9
help [C] [ARG] Shows this help or help for specified command.
10
info [ARGS] Shows a workspace overview and checks if it's valid.
11
libs Shows all libraries in the workspace.
12
migrate Migrates the workspace to the latest format.
13
shell Starts an interactive shell.
14
test [ARGS] Runs tests.
15
version Shows current version of the tool.
16
ws [get:X] Shows the workspace as data.
17
18
From the shell:
19
20
switch-ws ARG Switches to specified workspace.
21
tap [ARG] Opens a portal window that outputs tap> statements.
22
exit Exits the shell.
23
quit Quits the shell.
24
25
The ws-dir and ws-file parameters are replaced by switch-ws when executing commands
26
from the shell.
27
28
If ws-dir:PATH is passed in as an argument, where PATH is a relative
29
or absolute path, then the command is executed from that directory.
30
This works for all commands except 'test'.
31
If the 'switch-ws dir:DIR' command has been executed from a shell,
32
then ws-dir:DIR will automatically be appended to following commands.
33
34
If ws-file:FILE is passed in, then the workspace will be populated with the content
35
from that file. All commands except 'create' and 'test' can be executed with this
36
parameter set. The FILE is created by executing the 'ws' command, e.g.:
37
'poly ws out:ws.edn'.
38
If the 'switch-ws file:FILE' command has been executed from a shell,
39
then ws-file:FILE will automatically be appended to following commands.
40
41
If :: is passed in, then ws-dir is set to the first parent directory (or current)
42
that contains a 'workspace.edn' config file. The exception is the 'test command'
43
that has to be executed from the workspace root.
44
45
If skip:PROJECTS is passed in, then the given project(s) will not be read from disk.
46
Both project names and aliases can be used and should be separated by : if more than one.
47
48
If since:SINCE is passed in as an argument, the last stable point in time will be
49
used depending on the value of SINCE (or the first commit if no match was found).
50
If prefixed with 'previous-', e.g. 'previous-release', then the SHA directly before
51
the most recent matching tag of the 'release' pattern will be used:
52
stable -> the latest tag that matches stable-*, defined by
53
:tag-patterns > :stable in workspace.edn.
54
release -> the latest tag that matches v[0-9]*, defined by
55
:tag-patterns > :release in workspace.edn.
56
KEY -> any key in :tag-patterns.
57
SHA -> a git SHA-1 hash (if no key was found in :tag-patterns).
58
59
The color mode is taken from ~/.polylith/config.edn but can be overridden by passing
60
in color-mode:COLOR where valid colors are none, light, and dark.
61
62
Example (shell only):
63
switch-ws dir:~/myworkspace
64
switch-ws file:../../another/ws.edn
65
tap
66
tap open
67
tap clean
68
tap close
69
70
Example:
71
poly check
72
poly create c name:user
73
poly create component name:user
74
poly create component name:admin interface:user
75
poly create base name:mybase
76
poly create project name:myproject
77
poly create w top-ns:com.my.company
78
poly create workspace name:myws top-ns:com.my.company
79
poly create workspace name:myws top-ns:com.my.company branch:master
80
poly deps
81
poly deps project:myproject
82
poly deps brick:mybrick
83
poly deps project:myproject brick:mybrick
84
poly diff
85
poly help
86
poly help info
87
poly help create
88
poly help create component
89
poly help create base
90
poly help create project
91
poly help create workspace
92
poly help deps
93
poly help deps :project
94
poly help deps :brick
95
poly help deps :project :brick
96
poly info
97
poly info :loc
98
poly info since:65a7918
99
poly info since:head
100
poly info since:head~1
101
poly info since:stable
102
poly info since:release
103
poly info since:previous-release
104
poly info skip:dev
105
poly info skip:dev:myproject
106
poly info project:myproject
107
poly info project:myproject:another-project
108
poly info brick:mycomponent
109
poly info brick:mycomponent:mybase
110
poly info :project
111
poly info :dev
112
poly info :project :dev
113
poly info :all
114
poly info :all-bricks
115
poly info ::
116
poly info color-mode:none
117
poly info ws-dir:another-ws
118
poly info ws-file:ws.edn
119
poly libs
120
poly migrate
121
poly shell
122
poly test
123
poly test :project
124
poly test :all-bricks
125
poly test :all
126
poly test project:proj1
127
poly test project:proj1:proj2
128
poly test brick:mycomponent
129
poly test brick:mycomponent:mybase
130
poly test :dev
131
poly test :project :dev
132
poly test :all-bricks :dev
133
poly test :all :dev
134
poly version
135
poly ws
136
poly ws get:keys
137
poly ws get:count
138
poly ws get:settings
139
poly ws get:user-input:args
140
poly ws get:user-input:args:0
141
poly ws get:settings:keys
142
poly ws get:components:keys
143
poly ws get:components:count
144
poly ws get:components:mycomp:lines-of-code
145
poly ws get:settings:vcs:polylith :latest-sha
146
poly ws get:settings:vcs:polylith :latest-sha branch:master
147
poly ws get:changes:changed-or-affected-projects skip:dev
148
poly ws out:ws.edn
Copied!

check

1
Validates the workspace.
2
3
poly check
4
5
Prints 'OK' and returns 0 if no errors were found.
6
If errors or warnings were found, show messages and return the error code,
7
or 0 if only warnings. If internal errors, 1 is returned.
8
9
Error 101 - Illegal dependency on namespace.
10
Triggered if a :require statement refers to a component namespace
11
other than interface. Examples of valid namespaces:
12
- com.my.company.mycomponent.interface
13
- com.my.company.mycomponent.interface.subns
14
- com.my.company.mycomponent.interface.my.subns
15
16
Error 102 - Function or macro is defined twice.
17
Triggered if a function or macro is defined twice in the same namespace.
18
19
Error 103 - Missing definitions.
20
Triggered if a def, defn or defmacro definition exists in one component's
21
interface but is missing in another component that uses the same interface.
22
23
Error 104 - Circular dependencies.
24
Triggered if circular dependencies were detected, e.g.:
25
Component A depends on B that depends on A (A > B > A), or A > B > C > A.
26
27
Error 105 - Illegal name sharing.
28
Triggered if a base has the same name as a component or interface.
29
Projects and profiles can be given any name.
30
31
Error 106 - Multiple components that share the same interfaces in a project.
32
Triggered if a project contains more than one component that shares the
33
same interface.
34
35
Error 107 - Missing components in project.
36
Triggered if a component depends on an interface that is not included in the
37
project. The solution is to add a component to the project that
38
implements the interface.
39
40
Error 108 - Components with an interface that is implemented by more than one
41
component are not allowed for the development project.
42
The solution is to remove the component from the development project
43
and define the paths for each component in separate profiles
44
(including test paths).
45
46
Warning 201 - Mismatching parameter lists in function or macro.
47
Triggered if a function or macro is defined in the interface for a component
48
but also defined in the same interface for another component but with a
49
different parameter list.
50
51
Warning 202 - Missing paths in project.
52
Triggered if a path in a project doesn't exist on disk.
53
The solution is to add the file or directory, or to remove the path.
54
55
Warning 203 - Path exists in both dev and profile.
56
It's discouraged to have the same path in both the development project
57
and a profile. The solution is to remove the path from dev or the profile.
58
59
Warning 204 - Library exists in both dev and a profile.
60
It's discouraged to have the same library in both development and a profile.
61
The solution is to remove the library from dev or the profile.
62
63
Warning 205 - Non top namespace was found in brick.
64
Triggered if a namespace in a brick doesn't start with the top namespaces
65
defined in :top-namespace in ./workspace.edn.
Copied!

create

1
Creates a component, base, project or workspace.
2
3
poly create TYPE [ARGS]
4
TYPE = c[omponent] -> Creates a component.
5
b[ase] -> Creates a base.
6
p[roject] -> Creates a project.
7
w[orkspace] -> Creates a workspace.
8
9
ARGS = Varies depending on TYPE. To get help for a specific TYPE, type:
10
poly help create TYPE
11
12
Example:
13
poly create c name:user
14
poly create component name:user
15
poly create component name:admin interface:user
16
poly create base name:mybase
17
poly create project name:myproject
18
poly create workspace name:myws top-ns:com.my.company
19
poly create workspace name:myws top-ns:com.my.company branch:master
Copied!

create component

1
Creates a component.
2
3
poly create component name:NAME [interface:INTERFACE]
4
NAME = The name of the component to create.
5
6
INTERFACE = The name of the interface (namespace) or NAME if not given.
7
8
Example:
9
poly create c name:user
10
poly create component name:user
11
poly create component name:admin interface:user
Copied!

create base

1
Creates a base.
2
3
poly create base name:NAME
4
NAME = The name of the base to create.
5
6
Example:
7
poly create b name:mybase
8
poly create base name:mybase
Copied!

create project

1
Creates a project.
2
3
poly create project name:NAME
4
NAME = The name of the project to create.
5
6
Example:
7
poly create p name:myproject
8
poly create project name:myproject
Copied!

create workspace

1
Creates a workspace in current directory. If the workspace is created within
2
an existing git repo, then that repository will be used. If the workspace is
3
created outside a git repo, then a new repo will be initiated using the 'main'
4
branch, if another branch is not explicitly given.
5
In both cases, all the created files and directories will be committed to the
6
repo in a single commit with the text 'Workspace created.'.
7
8
poly create workspace [name:NAME] top-ns:TOP-NAMESPACE [branch:BRANCH]
9
NAME = The name of the workspace to create, which must be given
10
if created outside a git repository. Otherwise it's optional.
11
12
TOP-NAMESPACE = The top namespace, e.g. com.my.company.
13
14
BRANCH = The name of the branch, e.g. master. Default is main.
15
16
Example:
17
poly create w name:myws top-ns:com.my.company
18
poly create workspace name:myws top-ns:com.my.company
19
poly create workspace name:myws top-ns:com.my.company branch:master
Copied!

deps

1
Shows dependencies.
2
3
poly deps [project:PROJECT] [brick:BRICK]
4
(omitted) = Show workspace dependencies.
5
PROJECT = Show dependencies for specified project.
6
BRICK = Show dependencies for specified brick.
7
8
To get help for a specific diagram, type:
9
poly help deps ARGS:
10
ARGS = :brick Help for the brick diagram.
11
:project Help for the project diagram.
12
:workspace Help for the workspace diagram.
13
:project :brick Help for the project/brick diagram.
14
15
Example:
16
poly deps
17
poly deps project:myproject
18
poly deps brick:mybrick
19
poly deps project:myproject brick:mybrick
Copied!

deps :brick

1
Shows dependencies for selected brick.
2
3
poly deps brick:BRICK
4
BRICK = The name of the brick to show dependencies for.
5
6
used by < user > uses
7
------- ----
8
payer util
9
10
In this example, user is used by payer and it uses util itself.
11
If a brick or interface ends with '(t)' then it indicatest that
12
it's only used from the test context.
13
14
Example:
15
poly deps brick:mybrick
Copied!

deps :project

1
Shows dependencies for selected project.
2
3
poly deps project:PROJEXT
4
PROJECT = The project name or alias to show dependencies for.
5
6
p
7
a u u
8
y s t
9
e e i
10
brick r r l
11
--------------
12
payer . x t
13
user . . x
14
util . . .
15
cli x + +
16
17
When the project is known, we also know which components are used.
18
19
In this example, payer uses user in the src context, and util only
20
in the test context. user uses util, and cli uses payer. The 't'
21
means that payer is only used in the test context by user. The +
22
signs mark indirect dependencies, while - signs (not present here)
23
mark indirect dependencies in the test context. Here the cli base
24
depends on user and util, via 'cli > payer > user' and
25
'cli > payer > util'. Each usage comes from at least one :require
26
statement in the brick.
27
28
Example:
29
poly deps project:myproject
Copied!

deps :workspace

1
Shows dependencies for the workspace.
2
3
poly deps
4
5
p
6
a u u
7
y s t
8
e e i
9
brick r r l
10
--------------
11
payer . x t
12
user . . x
13
util . . .
14
cli x . .
15
16
In this example, payer uses user from the src context, and util from
17
the test context (indicated by 't'). user uses util and cli uses payer.
18
Each usage comes from at least one :require statement in the brick.
Copied!

deps :project :brick

1
Shows dependencies for selected brick and project.
2
3
poly deps project:PROJECT brick:BRICK
4
PROJECT = The project (name or alias) to show dependencies for.
5
BRICK = The brick to show dependencies for.
6
7
used by < user > uses
8
------- ----
9
payer util
10
11
In this example, user is used by payer and it uses util itself.
12
If a brick ends with '(t)' then it indicatest that it's only used
13
from the test context.
14
15
Example:
16
poly deps project:myproject brick:mybrick
Copied!

diff

1
Shows changed files since the most recent stable point in time.
2
3
poly diff
4
5
Internally, it executes 'git diff SHA --name-only' where SHA is the SHA-1
6
of the first commit in the repository, or the SHA-1 of the most recent tag
7
that matches the default pattern 'stable-*'.
8
9
Stable points are normally set by the CI server or by individual developers,
10
e.g. Lisa, with 'git tag -f stable-lisa'.
11
12
The pattern can be changed in :tag-patterns in workspace.edn.
13
14
The way the latest tag is found is by taking the first line that matches the 'stable-*'
15
regular expression, or if no match was found, the first commit in the repository.
16
git log --pretty=format:'%H %d'
17
18
Here is a compact way of listing all the commits including tags:
19
git log --pretty=oneline
Copied!

info

1
Shows workspace information.
2
3
poly info [ARGS]
4
ARGS = :loc -> Shows the number of lines of code for each brick
5
and project.
6
7
In addition to :loc, all the arguments used by the 'test' command
8
can also be used as a way to see what tests will be executed.
9
10
stable since: dec73ec | stable-lisa
11
12
projects: 2 interfaces: 3
13
bases: 1 components: 4
14
15
active profiles: default
16
17
project alias status dev admin
18
--------------------------- ----------
19
command-line cl --- --- --
20
development dev s-- s-- --
21
22
interface brick cl dev admin
23
----------------- --- ----------
24
payer payer s-- st- --
25
user admin s-- --- s-
26
user user * --- st- --
27
util util s-- st- --
28
- cli s-- st- --
29
30
This example shows a sample workspace. Let's go through each section:
31
32
1. stable since: dec73ec | stable-lisa
33
34
Shows the most recent commit marked as stable, or the last release if
35
since:release or since:previous-release was given, or the first commit
36
in the repository if no tag was found, followed by the tag (if found).
37
More information can be found in the 'diff' command help.
38
39
2. projects: 2 interfaces: 3
40
bases: 1 components: 4
41
42
Shows how many projects, bases, components and interfaces there are
43
in the workspace.
44
45
3. active profiles: default
46
47
Shows the names of active profiles. The profile paths are merged into the
48
development project. A profiles is an alias in ./deps.edn that starts
49
with a +. If no profile is selected, the default profile is automatically
50
selected.
51
52
Profiles are activated by passing them in by name (prefixed with '+'), e.g.:
53
poly info +admin +onemore
54
55
To deactivate all the profiles, and stop 'default' from being merged into
56
the development project, type:
57
poly info +
58
59
4. project alias status dev admin
60
--------------------------- ----------
61
command-line cl --- --- --
62
development dev s-- s-- --
63
64
This table lists all projects. The 'project' column shows the name
65
of the projects, which are the directory names under the 'projects',
66
directory except for 'development' that stores its code under the
67
'development' directory. If any file within the project directory has
68
changed, then it will be marked with a *. If that's not the case, but
69
any of the included bricks are changed, then it will be marked with a +.
70
71
The 'deps.edn' config files are stored under each project, except for
72
the development project that stores it at the workspace root.
73
74
Aliases are configured in :projects in ./workspace.edn.
75
76
The 'status' column has three flags with different meaning:
77
s-- The project has a 'src' directory, e.g.
78
'projects/command-line/src'.
79
-t- The project has a 'test' directory, e.g.
80
'projects/command-line/test'.
81
--x The project tests (its own) are marked for execution.
82
83
To show the 'resources' directory, also pass in :r or :resources, e.g.
84
'poly info :r':
85
s--- The project has a 'src' directory, e.g.
86
'projects/command-line/src'.
87
-r-- The project has a 'resources' directory, e.g.
88
'projects/command-line/resources'.
89
--t- The project has a 'test' directory, e.g.
90
'projects/command-line/test'
91
---x The project tests (its own) are marked for execution.
92
93
The dev column has three flags with different meaning:
94
s-- The project's 'src' directory, e.g.
95
'projects/command-line/src' is added to './deps.edn'
96
(or indirectly added as :local/root).
97
-t- The project's 'test' directory, e.g.
98
'projects/command-line/test' is added to './deps.edn'
99
(or indirectly added as :local/root).
100
--x The project tests are marked for execution from development.
101
102
The last admin column, is a profile:
103
s- The profile contains a path to the 'src' directory, e.g.
104
'projects/command-line/src'.
105
-t The profile contains a path to the 'test' directory, e.g.
106
'projects/command-line/test'.
107
108
If also passing in :r or :resources, e.g. 'poly info +r':
109
s-- The profile contains a path to the 'src' directory, e.g.
110
'projects/command-line/src'.
111
-r- The profile contains a path to the 'resources' directory, e.g.
112
'projects/command-line/resources'.
113
--t The profile contains a path to the 'test' directory, e.g.
114
'projects/command-line/test'.
115
116
5. interface brick cl dev admin
117
----------------- --- ----------
118
payer payer s-- st- --
119
user admin s-- --- st
120
user user * --- st- --
121
util util s-- st- --
122
- cli s-- st- --
123
124
This table lists all bricks and in which projects and profiles they are
125
added to.
126
127
The 'interface' column shows what interface the component has. The name
128
is the first namespace after the top namespace, e.g.:
129
com.my.company.user.interface
130
131
The 'brick' column shows the name of the brick, in green if a component or
132
blue if a base. Each component lives in a directory under the 'components'
133
directory and each base lives under the 'bases' directory. If any file for
134
a brick has changed since the last stable point in time, it will be marked
135
with an asterisk, * (user in this example).
136
137
The changed files can be listed by executing 'poly diff'.
138
139
The next cl column is the command-line project that lives under the
140
'projects' directory. Each line in this column says whether a brick is
141
included in the project or not.
142
The flags mean:
143
s-- The project contains a path to the 'src' directory, e.g.
144
'components/user/src' (or is indirectly added by a :local/root).
145
-t- The project contains a path to the 'test' directory, e.g.
146
'components/user/test' (or is indirectly added by a :local/root).
147
--x The brick is marked to be executed from this project.
148
149
If :r or :resources is also passed in:
150
s--- The project contains a path to the 'src' directory, e.g.
151
'components/user/src' (or is indirectly added by a :local/root).
152
-r-- The project contains a path to the 'resources' directory, e.g.
153
'components/user/resources' (or is indirectly added by a :local/root).
154
--t- The project contains a path to the 'test' directory, e.g.
155
'components/user/test' (or is indirectly added by a :local/root).
156
---x The brick is marked to be executed from this project.
157
158
The next group of columns, dev admin, is the development project with
159
its profiles. If passing in a plus with 'poly info +' then it will also show
160
the default profile. The flags for the dev project works the same
161
as for cl.
162
163
The flags for the admin profile means:
164
s- The profile contains a path to the 'src' directory, e.g.
165
'components/user/src'.
166
-t The profile contains a path to the 'test' directory, e.g.
167
'components/user/test'
168
169
It's not enough that a path has been added to a project to show an 'x',
170
the file or directory must also exist.
171
172
If any warnings or errors were found in the workspace, they will be listed at
173
the end, see the 'check' command help, for a complete list of validations.
174
175
Example:
176
poly info
177
poly info :loc
178
poly info since:release
179
poly info since:previous-release
180
poly info project:myproject
181
poly info project:myproject:another-project
182
poly info brick:mycomponent
183
poly info brick:mycomponent:mybase
184
poly info :project
185
poly info :dev
186
poly info :project :dev
187
poly info :all
188
poly info :all-bricks
189
poly info ws-dir:another-ws
190
poly info ws-file:ws.edn
Copied!

libs

1
Shows all libraries that are used in the workspace.
2
3
poly libs [:all]
4
:all = View all bricks, including those without library dependencies.
5
:compact = Show the table in a more compact way.
6
u u
7
s t
8
e i
9
library version type KB cl dev default admin r l
10
---------------------------------------------------- -- ------------------- ----
11
antlr/antlr 2.7.7 maven 434 x x - - . x
12
clj-time 0.15.2 maven 23 x x - - x .
13
org.clojure/clojure 1.10.1 maven 3,816 x x - - . .
14
org.clojure/tools.deps.alpha 0.12.985 maven 46 x x - - . .
15
16
In this example we have four libraries used by the cl and dev projects.
17
If any of the libraries are added to the default or admin profiles, they will appear
18
as an x in these columns. Remember that src and test sources live together in a profile,
19
which is fine because they are only used from the development project.
20
21
The x for the cl and dev columns says that the library is part of the src scope.
22
If a library is only used from the test scope, then it is marked with a 't'. A library
23
used in the test scope, can either be specified directly by the project itself via
24
:aliases > :test > :extra-deps or indirectly via included bricks in :deps > :local/root
25
which will be picked up and used by the 'test' command.
26
27
The x in the user column, tells that clj-time is used by that component
28
by having it specified in its 'deps.edn' file as a src dependency.
29
If a dependency is only used from the test scope, then it will turn up as a t.
30
31
Libraries can also be selected per project and it's therefore possible to have
32
different versions of the same library in different projects (if needed).
33
Use the :override-deps key in the project's 'deps.edn' file to explicitly set
34
a version for one or several libraries in a project.
35
36
The 'type' column says in what way the dependency is included:
37
- maven, e.g.: clj-time/clj-time {:mvn/version "0.15.2"}
38
- local, e.g.: clj-time {:local/root "/local-libs/clj-time-0.15.2.jar"}
39
- git, e.g.: clj-time/clj-time {:git/url "https://github.com/clj-time/clj-time.git"
40
:sha "d9ed4e46c6b42271af69daa1d07a6da2df455fab"}
41
42
The KB column shows the size in kilobytes, which is the size of the jar
43
file for Maven and Local dependencies, and the size of all files in the
44
~/.gitlibs/libs/YOUR-LIBRARY directory for Git dependencies.
Copied!

migrate

1
Migrates a workspace to the latest version.
2
3
poly migrate
4
5
If the workspace hasn't been migrated already, then this command will create a new
6
./workspace.edn file + a deps.edn file per brick. All project deps.edn files will be
7
updated. The libraries in each project's deps.edn file will be sorted, so it can be
8
an idea to manually change that order and put bricks first followed by the libraries.
9
10
The migration tool will use the :ns-to-lib key to figure out what libraries are
11
used in each brick. After the migration, it's recommended to go through all the
12
bricks and make sure that all libraries it uses are also specified in each brick's
13
deps.edn file.
14
15
Continue by updating each project's deps.edn file and remove libraries that are
16
already indirectly included by bricks (via :local/root).
17
The paths in ./deps.edn is left untouched and the reason is that the :local/root
18
syntax is not supported by all IDE's.
19
20
Starting from version 0.2.0-alpha10, the tool supports specifying dependencies per
21
brick in its own deps.edn files. Workspace specific config is stored in ./workspace.edn
22
instead of the :polylith key in ./deps which was the case prior to this version.
Copied!

shell

1
poly [shell]
2
3
Starts an interactive shell with the name of the selected workspace, e.g.:
4
myworkspacegt;
5
6
From here we can execute any poly command, e.g.:
7
myworkspacegt; info
8
9
We can also use the built in autocomplete, e.g.:
10
myworkspacegt; i
11
12
...and when pressing the <tab> key, the 'i' is completed to 'info'.
13
14
This works for both commands and arguments, and is context sensitive.
15
If we for example type:
16
myworkspacegt; deps brick:mybrick project:
17
18
...and press <tab>, it will only suggest projects that include 'mybrick'.
19
20
Parameters that start with a : can be selected by just typing their name,
21
e.g. 'l' will select ':loc'. To distinguish between 'project:PROJECT' and
22
':project' we need to type ':p' to select ':project'.
23
24
From the shell we also have access to these commands:
25
switch-ws ARG Switches to selected workspace.
26
tap [ARG] Opens (or closes/cleans) a portal window that outputs tap> statements.
27
exit Exits the shell.
28
quit Quits the shell.
29
30
An alternative way of exiting the shell is by pressing <ctrl>+C or <ctrl>+D.
Copied!

switch-ws

1
Selects which workspace to be used by commands executed from the shell.
2
This replaces the use of ws-dir:DIR and ws-file:FILE, which will be appended
3
automatically when executing commands, if dir:DIR or file:FILE is given.
4
5
switch-ws ARG
6
ARG = dir:DIR Switches to the selected workspace directory.
7
The prompt will be prefixed with 'dir:' to show this.
8
file:FILE Switches to the workspace specified in the selected file,
9
created by something like 'poly ws out:ws.edn'.
10
The prompt will be prefixed with 'file:' to show this.
11
12
Example:
13
switch-ws dir:~/myworkspace
14
switch-ws file:../../another/ws.edn
Copied!

tap

1
Opens (or closes/cleans) a portal window (https://github.com/djblue/portal)
2
where tap> statements are sent to. This command is used from the shell and
3
is mainly used internally when developing the poly tool itself.
4
5
tap [ARG]
6
ARG = (omitted) Opens a portal window.
7
open Opens a portal window.
8
close Closes the portal window
9
clear Clears the portal window
10
11
Example:
12
tap
13
tap open
14
tap clean
15
tap close
Copied!

test

1
Executes brick and/or project tests.
2
3
poly test [ARGS]
4
5
The brick tests are executed from all projects they belong to except for the development
6
project (if not :dev is passed in):
7
8
ARGS Tests to execute
9
---------------- -------------------------------------------------------------
10
(empty) All brick tests that are directly or indirectly changed.
11
12
:project All brick tests that are directly or indirectly changed +
13
tests for changed projects.
14
15
:all-bricks All brick tests.
16
17
:all All brick tests + all project tests (except development).
18
19
20
To execute the brick tests from the development project, also pass in :dev:
21
22
ARGS Tests to execute
23
---------------- -------------------------------------------------------------
24
:dev All brick tests that are directly or indirectly changed,
25
only executed from the development project.
26
27
:project :dev All brick tests that are directly or indirectly changed,
28
executed from all projects (development included) +
29
tests for changed projects (development included).
30
31
:all-bricks :dev All brick tests, executed from all projects
32
(development included).
33
34
:all :dev All brick tests, executed from all projects
35
(development included) + all project tests
36
(development included).
37
38
Projects can also be explicitly selected with e.g. project:proj1 or
39
project:proj1:proj2. Specifying :dev is a shortcut for project:dev.
40
41
We can also specify which bricks to include, by listing them like this:
42
brick:mycomponent:another-component:mybase
43
44
Example:
45
poly test
46
poly test :project
47
poly test :all-bricks
48
poly test :all
49
poly test project:proj1
50
poly test project:proj1:proj2
51
poly test brick:mycomponent
52
poly test brick:mycomponent:mybase
53
poly test :dev
54
poly test :project :dev
55
poly test :all-bricks :dev
56
poly test :all :dev
Copied!

ws

1
Prints or writes the workspace as data.
2
3
poly ws [get:ARG] [out:FILE] [:latest-sha] [branch:BRANCH]
4
ARG = keys -> Lists the keys for the data structure:
5
- If it's a hash map, it returns all its keys.
6
- If it's a list and its elements are hash maps,
7
it returns a list with all the :name keys.
8
9
count -> Counts the number of elements.
10
11
KEY -> If applied to a hash map, it returns the value of the KEY.
12
If applied to a list of hash maps, it returns the hash map with
13
a matching :name. Projects are also matched against :alias.
14
15
INDEX -> A list element can be looked up by INDEX.
16
17
Several ARG keys can be given, separated by colon.
18
Every new key goes one level deeper into the workspace data structure.
19
20
FILE = Writes the output to the specified FILE. Will have the same effect
21
as setting color-mode:none and piping the output to a file.
22
23
:latest-sha = if passed in, then settings:vcs:polylith:latest-sha will be set.
24
If A branch is given, e.g., branch:master, then the latest sha will be
25
retrieved from that branch.
26
27
Example:
28
poly ws
29
poly ws get:keys
30
poly ws get:count
31
poly ws get:settings
32
poly ws get:user-input:args
33
poly ws get:user-input:args:0
34
poly ws get:settings:keys
35
poly ws get:components:keys
36
poly ws get:components:count
37
poly ws get:components:mycomp:lines-of-code
38
poly ws get:settings:vcs:polylith :latest-sha
39
poly ws get:settings:vcs:polylith :latest-sha branch:master
40
poly ws out:ws.edn
41
poly ws color-mode:none > ws.edn
Copied!
Last modified 2mo ago