Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nushell-prophet/nu-history-tools
Nushell history tools!
https://github.com/nushell-prophet/nu-history-tools
cli history nushell
Last synced: 28 days ago
JSON representation
Nushell history tools!
- Host: GitHub
- URL: https://github.com/nushell-prophet/nu-history-tools
- Owner: nushell-prophet
- License: mit
- Created: 2023-09-04T09:22:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-29T06:40:02.000Z (about 1 month ago)
- Last Synced: 2024-08-29T08:09:43.741Z (about 1 month ago)
- Topics: cli, history, nushell
- Language: Nushell
- Homepage:
- Size: 569 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nu - nu-history-tools
README
nu-history-tools
Nushell๐ module for commands history analytics
A Nushell module to analyze the command frequencies in Nushell history, generate cool graphs, benchmark statistics with other users, and generate a file with statistics to share with the community.
Aggregated results, produced by the `aggregate-submissions` command can be found in the [csv file](https://github.com/nushell-prophet/nu-history-tools/tree/main/assets/script_results_examples/aggregated-submissions.csv)
The history of nushell commands by releases can be found in [this csv](https://github.com/nushell-prophet/nu-history-tools/blob/main/assets/crates_parsing/cmds_by_crates_and_tags.csv)
![nu-history-tools2](https://github.com/nushell-prophet/nu-history-tools/assets/4896754/5053ede0-d53a-46be-bd71-7f066eca7025)
## Installation
```nushell no-run
> git clone https://github.com/nushell-prophet/nu-history-tools; cd nu-history-tools; use nu-history-tools
```## Analyze your stats and benchmark them with other users' submissions.
The output of `analyze-history` contains a lot of informational messages (as you can see in the next block).
These informational messages can be silenced using the `--quiet` flag.```nushell
use nu-history-tools; let $res = nu-history-tools analyze-history; $res | first 10
```Output:
```
*******************************************************************************
nu-commands-frequency-stats v0.2.1
*******************************************************************************Your history is in sqlite format and will be used for analysis. Additionally,
you have history in txt format, which consists of 496 lines. It will be used
for analysis as well.Your stats have been saved to
/Users/user/git/nu-history-tools/stats_submissions/v2+WriteYourNick.csv.
Please consider donating them to the original repository
https://github.com/nushell-prophet/nu-history-tools/tree/main/stats_submissions
.*******************************************************************************
Aggregated stats of other users for benchmarks.
They will be displayed in the final table.
*******************************************************************************freq_by_user (frequency norm by user) includes stats from all users. You can
pick some of them by providing the --pick_users flag: stats --pick_users or
aggregate-submissions --pick_users.โญโ#โโโฌโโโโโโuserโโโโโโโฌโcommand_entriesโโฎ
โ 0 โ maximuvarov โ 120938 โ
โ 1 โ vinlet โ 33817 โ
โ 2 โ fdncred โ 18538 โ
โ 3 โ nu_scripts โ 11214 โ
โ 4 โ kubouch โ 10170 โ
โ 5 โ ErichDonGubler โ 10101 โ
โ 6 โ chtenb โ 9376 โ
โ 7 โ shinyzero0 โ 9247 โ
โ 8 โ dazfuller โ 7354 โ
โ 9 โ cptpiepmatz โ 4199 โ
โ 10 โ zjp โ 2764 โ
โ 11 โ sholderbach โ 2114 โ
โ 12 โ horasal โ 1373 โ
โ 13 โ nu_std โ 985 โ
โ 14 โ pingiun โ 894 โ
โ 15 โ nicokosi โ 255 โ
โฐโ#โโโดโโโโโโuserโโโโโโโดโcommand_entriesโโฏ
*******************************************************************************
Resulting table
*******************************************************************************
A note about some columns:
- freq - indicates the overall frequency of use of the given command for the
currently analyzed source
- freq_norm - represents the overall frequency normalized
- freq_norm_bar - shows the overall frequency normalized in a bar chart format
- timeline - displays the dynamics, indicating when the command was used
throughout your history
- importance - calculated as the geometric mean of the number of users who
used this command and the average normalized frequency
- freq_by_user (frequency norm by user) - each bar in the sparkline column
represents one user (order is shown in the table above).โญโ#โโฌโโnameโโโฌโโcategoryโโโฌโfreqโโฌโfreq_normโโฌโfreq_norm_barโโฌโโtimelineโโโโฌโimportanceโโฌโimportance_bโโฌโโโfreq_by_userโโโโฎ
โ 0 โ ls โ filesystem โ 7358 โ 1.00 โ โโโโโโโโโโ โ โ โโโโ โโโโโโ โ 1.00 โ โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโ โ
โ 1 โ get โ filters โ 7316 โ 0.99 โ โโโโโโโโโโ โ โโโโ โ โโโโโโ โ 0.83 โ โโโโโโโโโโ โ โโโ โโโโโโโโโโโโโ โ
โ 2 โ open โ filesystem โ 6279 โ 0.85 โ โโโโโโโโโ โ โโโ โโโโโ โ โ โ โ 0.79 โ โโโโโโโโโโ โ โโโโโโโโโโโโโโโโ โ
โ 3 โ let โ core โ 4256 โ 0.58 โ โโโโโโ โ โโโ โโ โ โโโ โ โ โ 0.64 โ โโโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โ 4 โ each โ filters โ 4091 โ 0.56 โ โโโโโโ โ โโโโโโ โโโโ โ โ 0.57 โ โโโโโโโ โ โ โโโโโโโโโโโโโโโ โ
โ 5 โ where โ filters โ 3648 โ 0.50 โ โโโโโ โ โโโโโโโโโโโ โ 0.51 โ โโโโโโโ โ โโโ โโ โโโโโโโ โโโโ โ
โ 6 โ upsert โ filters โ 2822 โ 0.38 โ โโโโ โ โ โ โโโโโโโโโ โ 0.17 โ โโ โ โโ โโโโโโโโโโโโโโ โ
โ 7 โ first โ filters โ 2404 โ 0.33 โ โโโโ โ โโโ โโ โโโโโโ โ 0.27 โ โโโโ โ โโโโโโโโโโโโโโโโ โ
โ 8 โ polars โ dataframe โ 2303 โ 0.31 โ โโโโ โ โโโโโโโโโโโ โ 0.05 โ โ โ โโโโโโโโโโโโโโโโ โ
โ 9 โ lines โ filters โ 2041 โ 0.28 โ โโโ โ โโโโโโโ โโโโ โ 0.45 โ โโโโโโ โ โโโโโโโโโโ โโโโโโ โ
โฐโ#โโดโโnameโโโดโโcategoryโโโดโfreqโโดโfreq_normโโดโfreq_norm_barโโดโโtimelineโโโโดโimportanceโโดโimportance_bโโดโโโfreq_by_userโโโโฏ
```## Analyze submissions separately
```nushell
> use nu-history-tools; let $res2 = nu-history-tools aggregate-submissions --quiet; $res2 | first 5
โญโ#โโฌโnameโโฌโโcategoryโโโฌโfreq_overallโโฌโusers_countโโฌโf_n_per_userโโฌโโโfreq_by_userโโโโฌโimportanceโโฌโimportance_bโโฎ
โ 0 โ ls โ filesystem โ 15045 โ 14 โ 0.62 โ โโโโโโโโโโโโโโโโ โ 1.00 โ โโโโโโโโโโโโ โ
โ 1 โ cd โ filesystem โ 8492 โ 15 โ 0.43 โ โโโโโโโโโโโโโโโโ โ 0.87 โ โโโโโโโโโโโ โ
โ 2 โ get โ filters โ 13710 โ 16 โ 0.37 โ โโโ โโโโโโโโโโโโโ โ 0.83 โ โโโโโโโโโโ โ
โ 3 โ open โ filesystem โ 12561 โ 15 โ 0.36 โ โโโโโโโโโโโโโโโโ โ 0.79 โ โโโโโโโโโโ โ
โ 4 โ help โ core โ 3397 โ 14 โ 0.29 โ โโโ โโโโโโโโโโโโโ โ 0.69 โ โโโโโโโโโ โ
โฐโ#โโดโnameโโดโโcategoryโโโดโfreq_overallโโดโusers_countโโดโf_n_per_userโโดโโโfreq_by_userโโโโดโimportanceโโดโimportance_bโโฏ
```