bashhub 3.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. bashhub-3.0.2/LICENSE.md +190 -0
  2. bashhub-3.0.2/MANIFEST.in +5 -0
  3. bashhub-3.0.2/PKG-INFO +203 -0
  4. bashhub-3.0.2/README.md +175 -0
  5. bashhub-3.0.2/bashhub/__init__.py +0 -0
  6. bashhub-3.0.2/bashhub/bashhub.py +240 -0
  7. bashhub-3.0.2/bashhub/bashhub_globals.py +83 -0
  8. bashhub-3.0.2/bashhub/bashhub_setup.py +237 -0
  9. bashhub-3.0.2/bashhub/bh.py +125 -0
  10. bashhub-3.0.2/bashhub/i_search.py +157 -0
  11. bashhub-3.0.2/bashhub/interactive_search.py +120 -0
  12. bashhub-3.0.2/bashhub/model/__init__.py +6 -0
  13. bashhub-3.0.2/bashhub/model/command.py +55 -0
  14. bashhub-3.0.2/bashhub/model/command_form.py +15 -0
  15. bashhub-3.0.2/bashhub/model/min_command.py +13 -0
  16. bashhub-3.0.2/bashhub/model/serializable.py +47 -0
  17. bashhub-3.0.2/bashhub/model/status_view.py +15 -0
  18. bashhub-3.0.2/bashhub/model/system.py +42 -0
  19. bashhub-3.0.2/bashhub/rest_client.py +251 -0
  20. bashhub-3.0.2/bashhub/shell/bashhub.fish +105 -0
  21. bashhub-3.0.2/bashhub/shell/bashhub.sh +73 -0
  22. bashhub-3.0.2/bashhub/shell/bashhub.zsh +65 -0
  23. bashhub-3.0.2/bashhub/shell/deps/bash-preexec.sh +341 -0
  24. bashhub-3.0.2/bashhub/shell/deps/lib-bashhub.sh +161 -0
  25. bashhub-3.0.2/bashhub/shell_utils.py +17 -0
  26. bashhub-3.0.2/bashhub/version.py +5 -0
  27. bashhub-3.0.2/bashhub/view/__init__.py +0 -0
  28. bashhub-3.0.2/bashhub/view/status.py +25 -0
  29. bashhub-3.0.2/bashhub.egg-info/PKG-INFO +203 -0
  30. bashhub-3.0.2/bashhub.egg-info/SOURCES.txt +41 -0
  31. bashhub-3.0.2/bashhub.egg-info/dependency_links.txt +1 -0
  32. bashhub-3.0.2/bashhub.egg-info/entry_points.txt +3 -0
  33. bashhub-3.0.2/bashhub.egg-info/requires.txt +10 -0
  34. bashhub-3.0.2/bashhub.egg-info/top_level.txt +1 -0
  35. bashhub-3.0.2/pyproject.toml +52 -0
  36. bashhub-3.0.2/setup.cfg +4 -0
  37. bashhub-3.0.2/tests/test_bashhub.py +55 -0
  38. bashhub-3.0.2/tests/test_bashhub_globals.py +27 -0
  39. bashhub-3.0.2/tests/test_bashhub_setup.py +62 -0
  40. bashhub-3.0.2/tests/test_command.py +32 -0
  41. bashhub-3.0.2/tests/test_command_form.py +19 -0
  42. bashhub-3.0.2/tests/test_interactive_search.py +96 -0
  43. bashhub-3.0.2/tests/test_shell_utils.py +12 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2015 Ryan Caloras
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include bashhub/shell/*.zsh
3
+ include bashhub/shell/*.sh
4
+ include bashhub/shell/deps/*.sh
5
+ include bashhub/model/*
bashhub-3.0.2/PKG-INFO ADDED
@@ -0,0 +1,203 @@
1
+ Metadata-Version: 2.4
2
+ Name: bashhub
3
+ Version: 3.0.2
4
+ Summary: Bashhub.com python client
5
+ Author-email: Ryan Caloras <ryan@bashhub.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/rcaloras/bashhub-client
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Requires-Python: <3.15,>=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE.md
18
+ Requires-Dist: requests>=2.32.5
19
+ Requires-Dist: jsonpickle>=4.1.1
20
+ Requires-Dist: click>=8.1.8
21
+ Requires-Dist: npyscreen>=5.0.2
22
+ Requires-Dist: python-dateutil>=2.9.0.post0
23
+ Requires-Dist: inflection>=0.5.1
24
+ Requires-Dist: humanize>=4.13.0
25
+ Provides-Extra: test
26
+ Requires-Dist: pytest>=3.3.1; extra == "test"
27
+ Dynamic: license-file
28
+
29
+ <img src="https://bashhub.com/assets/images/bashhub-logo.png" alt="Bashhub Logo">
30
+
31
+ Bashhub saves every terminal command entered across all sessions and systems and provides powerful querying across all commands.
32
+
33
+ [![Build Status](https://github.com/rcaloras/bashhub-client/actions/workflows/main.yml/badge.svg)](https://github.com/rcaloras/bashhub-client/actions/)
34
+ [![GitHub version](https://badge.fury.io/gh/rcaloras%2Fbashhub-client.svg)](https://badge.fury.io/gh/rcaloras%2Fbashhub-client)
35
+
36
+ ### Features
37
+ - Super command search by using context about how commands are executed.
38
+ - e.g. the directory, session, system, exit status, etc.
39
+ - Unlimited detailed terminal history stored in the cloud.
40
+ - [Stored privately and encrypted at rest](https://github.com/rcaloras/bashhub-client/wiki/Security-and-Privacy).
41
+ - Support across systems. Access your terminal history from anywhere!
42
+ - Support for Bash and Zsh with a sweet cli for everything.
43
+
44
+ ![gif](http://i.imgur.com/02ABZxn.gif)
45
+
46
+ # Quick Install
47
+ ```shell
48
+ curl -OL https://bashhub.com/setup && $SHELL setup
49
+ ```
50
+ For non default login shells, just specify the shell e.g. (`bash setup`, `zsh setup`, `fish setup`)
51
+
52
+ Detailed installation instructions can be found at
53
+ https://github.com/rcaloras/bashhub-client/wiki/Install
54
+
55
+ # Usage
56
+ Bashhub can be accessed from the command line in a couple ways:
57
+
58
+ - `bh` for searching
59
+ - `bashhub` for everything else
60
+
61
+ It also provides a key binding of `ctrl + b` for quickly dropping into interactive search.
62
+
63
+ ## Search
64
+ You can search through your commands in a lot of different ways. Check `bh --help` for more specifics. By default `bh` will output the most recently used unique commands to standard out. Adding the `-i` argument to any `bh` search will make it **interactive**. There are also several arguments to pass to filter, query, and get more specific about your searches!
65
+
66
+ ## Examples
67
+
68
+ The last 100 commands you executed anywhere. (100 is default limit without `-n`)
69
+ ```bash
70
+ $ bh
71
+ ```
72
+
73
+ The last 20 files I've grep'd.
74
+ ```bash
75
+ $ bh -n 20 "grep"
76
+ ```
77
+ Find that wget command with interactive search to execute it again :P
78
+ ```bash
79
+ $ bh -i "wget github"
80
+ ```
81
+
82
+ ### Directory-specific Searching
83
+
84
+ The last commands you executed in this directory.
85
+ ```bash
86
+ $ bh -d
87
+ ```
88
+ The last 10 things you vim'd in this directory
89
+ ```bash
90
+ $ bh -d -n 10 "vim"
91
+ ```
92
+
93
+ ### System-specific Searching
94
+
95
+ The last 10 curl commands you produced on this system
96
+
97
+ ```bash
98
+ $ bh -sys -n 10 "curl"
99
+ ```
100
+
101
+ ### How Search Results are Ordered
102
+ By default results are sorted by **most recently** used, and are **unique**. This means frequent commands like `git status` or `ls` will only appear once in the position they were most recently invoked.
103
+
104
+ This can be altered by using the `-dups` command to include duplicates
105
+
106
+ Your git commands including duplicates.
107
+
108
+ ```bash
109
+ $ bh -dups "git"
110
+ ```
111
+
112
+ ## Interactive Search
113
+ One of the most useful features is interactive search which is accessed via `bh -i` or `ctrl + b`. This is similar to reverse search i.e. `ctrl + r`. Interactive search drops you into a small menu where you can select a command to run on the command line.
114
+
115
+ Enter interactive search for all the rsync commands executed in this directory
116
+ ```bash
117
+ $ bh -i -d
118
+ (bashhub-i-search): rsync
119
+ ```
120
+
121
+ ### Command Details
122
+ From interactive search you can also access detailed information on each command by hitting `i` or `space` on any listed command.
123
+
124
+ ![Command Details](http://i.imgur.com/is0gNnB.png)
125
+
126
+
127
+ ## Bashhub Status
128
+ You can get a summary of your user's stats/status by using the `status` command.
129
+ ```bash
130
+ bashhub status
131
+ ```
132
+ Most of this information is also displayed on the user profile page.
133
+
134
+ ```bash
135
+ === Bashhub Status
136
+ http://bashhub.com/u/rccola
137
+ Total Commands: 94965
138
+ Total Sessions: 16400
139
+ Total Systems: 18
140
+ ===
141
+ Session PID 15311 Started 9 days ago
142
+ Commands In Session: 3
143
+ Commands Today: 47
144
+ ```
145
+
146
+ ### Search with Fuzzy Finder
147
+ An efficient way of searching is using `bashhub` in combination with [`fzf`](https://github.com/junegunn/fzf). Put this in your `.bashrc`.
148
+
149
+ ```bash
150
+ function my_alias {
151
+ eval $(bh | fzf)
152
+ }
153
+ ```
154
+
155
+ This will make the function available globally in your terminal.
156
+
157
+ ## Filtering Commands
158
+ You can filter commands from being recorded to Bashhub via a regex set to the environment variable `BH_FILTER`. These commands will be ignored and omittted from Bashhub.
159
+ ```bash
160
+ # Filter out any commands for postgres or ssh
161
+ export BH_FILTER="(psql|ssh)"
162
+ ssh rcaloras@some-ip-address # will not be saved
163
+ ```
164
+
165
+ You can check the configuration of this command via the `bashhub filter` subcommand.
166
+ ```bash
167
+ # Check if a command is filtered by my regex
168
+ export BH_FILTER="(-p)"
169
+ bashhub filter "mysql -u root -p plain-text-password"
170
+ BH_FILTER=(-p)
171
+ mysql -u root -p plain-text-password
172
+ Is Filtered. Matched ['-p']
173
+ ```
174
+
175
+ ## Disabling Recording Commands
176
+ You can turn on/off recording to Bashhub via `bashhub on` and `bashhub off`. By default this only affects the current bash session.
177
+
178
+ ```bash
179
+ $ bashhub off
180
+ $ echo "Recording is now disabled for this session. This command won't be saved."
181
+ ....
182
+ $ bashhub on
183
+ $ echo "Recording commands is now re-enabled"
184
+ ```
185
+ You can disable for all sessions by setting `bashhub off --global` this sets `save_commands = False` in your bashhub config.
186
+
187
+ ## Ignoring Commands
188
+ `#ignore` added to any command will omit it from being saved. Simply add it to the end of any command and it won't be recorded in Bashhub.
189
+
190
+ ```bash
191
+ $ echo "this command won't be saved" #ignore
192
+ ```
193
+
194
+ ## Deleting Commands
195
+ You can delete commands from Bashhub through interactive search by pressing `Delete` or `Backspace` while a command is highlighted. A small dialog box will open to confirm the commands deletion. If a command is deleted, it is permanently removed from Bashhub.
196
+
197
+ ![gif](http://i.imgur.com/sHzvEJx.gif)
198
+
199
+ ## Feature Requests, Bugs, and Issues
200
+ Feel free to post in:
201
+ https://github.com/rcaloras/bashhub-client/issues
202
+
203
+ You can also get support and follow updates [@Bashhub](https://twitter.com/bashhub) on Twitter.
@@ -0,0 +1,175 @@
1
+ <img src="https://bashhub.com/assets/images/bashhub-logo.png" alt="Bashhub Logo">
2
+
3
+ Bashhub saves every terminal command entered across all sessions and systems and provides powerful querying across all commands.
4
+
5
+ [![Build Status](https://github.com/rcaloras/bashhub-client/actions/workflows/main.yml/badge.svg)](https://github.com/rcaloras/bashhub-client/actions/)
6
+ [![GitHub version](https://badge.fury.io/gh/rcaloras%2Fbashhub-client.svg)](https://badge.fury.io/gh/rcaloras%2Fbashhub-client)
7
+
8
+ ### Features
9
+ - Super command search by using context about how commands are executed.
10
+ - e.g. the directory, session, system, exit status, etc.
11
+ - Unlimited detailed terminal history stored in the cloud.
12
+ - [Stored privately and encrypted at rest](https://github.com/rcaloras/bashhub-client/wiki/Security-and-Privacy).
13
+ - Support across systems. Access your terminal history from anywhere!
14
+ - Support for Bash and Zsh with a sweet cli for everything.
15
+
16
+ ![gif](http://i.imgur.com/02ABZxn.gif)
17
+
18
+ # Quick Install
19
+ ```shell
20
+ curl -OL https://bashhub.com/setup && $SHELL setup
21
+ ```
22
+ For non default login shells, just specify the shell e.g. (`bash setup`, `zsh setup`, `fish setup`)
23
+
24
+ Detailed installation instructions can be found at
25
+ https://github.com/rcaloras/bashhub-client/wiki/Install
26
+
27
+ # Usage
28
+ Bashhub can be accessed from the command line in a couple ways:
29
+
30
+ - `bh` for searching
31
+ - `bashhub` for everything else
32
+
33
+ It also provides a key binding of `ctrl + b` for quickly dropping into interactive search.
34
+
35
+ ## Search
36
+ You can search through your commands in a lot of different ways. Check `bh --help` for more specifics. By default `bh` will output the most recently used unique commands to standard out. Adding the `-i` argument to any `bh` search will make it **interactive**. There are also several arguments to pass to filter, query, and get more specific about your searches!
37
+
38
+ ## Examples
39
+
40
+ The last 100 commands you executed anywhere. (100 is default limit without `-n`)
41
+ ```bash
42
+ $ bh
43
+ ```
44
+
45
+ The last 20 files I've grep'd.
46
+ ```bash
47
+ $ bh -n 20 "grep"
48
+ ```
49
+ Find that wget command with interactive search to execute it again :P
50
+ ```bash
51
+ $ bh -i "wget github"
52
+ ```
53
+
54
+ ### Directory-specific Searching
55
+
56
+ The last commands you executed in this directory.
57
+ ```bash
58
+ $ bh -d
59
+ ```
60
+ The last 10 things you vim'd in this directory
61
+ ```bash
62
+ $ bh -d -n 10 "vim"
63
+ ```
64
+
65
+ ### System-specific Searching
66
+
67
+ The last 10 curl commands you produced on this system
68
+
69
+ ```bash
70
+ $ bh -sys -n 10 "curl"
71
+ ```
72
+
73
+ ### How Search Results are Ordered
74
+ By default results are sorted by **most recently** used, and are **unique**. This means frequent commands like `git status` or `ls` will only appear once in the position they were most recently invoked.
75
+
76
+ This can be altered by using the `-dups` command to include duplicates
77
+
78
+ Your git commands including duplicates.
79
+
80
+ ```bash
81
+ $ bh -dups "git"
82
+ ```
83
+
84
+ ## Interactive Search
85
+ One of the most useful features is interactive search which is accessed via `bh -i` or `ctrl + b`. This is similar to reverse search i.e. `ctrl + r`. Interactive search drops you into a small menu where you can select a command to run on the command line.
86
+
87
+ Enter interactive search for all the rsync commands executed in this directory
88
+ ```bash
89
+ $ bh -i -d
90
+ (bashhub-i-search): rsync
91
+ ```
92
+
93
+ ### Command Details
94
+ From interactive search you can also access detailed information on each command by hitting `i` or `space` on any listed command.
95
+
96
+ ![Command Details](http://i.imgur.com/is0gNnB.png)
97
+
98
+
99
+ ## Bashhub Status
100
+ You can get a summary of your user's stats/status by using the `status` command.
101
+ ```bash
102
+ bashhub status
103
+ ```
104
+ Most of this information is also displayed on the user profile page.
105
+
106
+ ```bash
107
+ === Bashhub Status
108
+ http://bashhub.com/u/rccola
109
+ Total Commands: 94965
110
+ Total Sessions: 16400
111
+ Total Systems: 18
112
+ ===
113
+ Session PID 15311 Started 9 days ago
114
+ Commands In Session: 3
115
+ Commands Today: 47
116
+ ```
117
+
118
+ ### Search with Fuzzy Finder
119
+ An efficient way of searching is using `bashhub` in combination with [`fzf`](https://github.com/junegunn/fzf). Put this in your `.bashrc`.
120
+
121
+ ```bash
122
+ function my_alias {
123
+ eval $(bh | fzf)
124
+ }
125
+ ```
126
+
127
+ This will make the function available globally in your terminal.
128
+
129
+ ## Filtering Commands
130
+ You can filter commands from being recorded to Bashhub via a regex set to the environment variable `BH_FILTER`. These commands will be ignored and omittted from Bashhub.
131
+ ```bash
132
+ # Filter out any commands for postgres or ssh
133
+ export BH_FILTER="(psql|ssh)"
134
+ ssh rcaloras@some-ip-address # will not be saved
135
+ ```
136
+
137
+ You can check the configuration of this command via the `bashhub filter` subcommand.
138
+ ```bash
139
+ # Check if a command is filtered by my regex
140
+ export BH_FILTER="(-p)"
141
+ bashhub filter "mysql -u root -p plain-text-password"
142
+ BH_FILTER=(-p)
143
+ mysql -u root -p plain-text-password
144
+ Is Filtered. Matched ['-p']
145
+ ```
146
+
147
+ ## Disabling Recording Commands
148
+ You can turn on/off recording to Bashhub via `bashhub on` and `bashhub off`. By default this only affects the current bash session.
149
+
150
+ ```bash
151
+ $ bashhub off
152
+ $ echo "Recording is now disabled for this session. This command won't be saved."
153
+ ....
154
+ $ bashhub on
155
+ $ echo "Recording commands is now re-enabled"
156
+ ```
157
+ You can disable for all sessions by setting `bashhub off --global` this sets `save_commands = False` in your bashhub config.
158
+
159
+ ## Ignoring Commands
160
+ `#ignore` added to any command will omit it from being saved. Simply add it to the end of any command and it won't be recorded in Bashhub.
161
+
162
+ ```bash
163
+ $ echo "this command won't be saved" #ignore
164
+ ```
165
+
166
+ ## Deleting Commands
167
+ You can delete commands from Bashhub through interactive search by pressing `Delete` or `Backspace` while a command is highlighted. A small dialog box will open to confirm the commands deletion. If a command is deleted, it is permanently removed from Bashhub.
168
+
169
+ ![gif](http://i.imgur.com/sHzvEJx.gif)
170
+
171
+ ## Feature Requests, Bugs, and Issues
172
+ Feel free to post in:
173
+ https://github.com/rcaloras/bashhub-client/issues
174
+
175
+ You can also get support and follow updates [@Bashhub](https://twitter.com/bashhub) on Twitter.
File without changes