Nextflow: JSON output for `nextflow info`

Created on 16 Apr 2018  路  6Comments  路  Source: nextflow-io/nextflow

It would be great if nextflow list command showed some additional information about each pipeline that is in the nextflow cache.

Most useful info would be (in order of preference):

  • [x] ~Name~
  • [ ] Commit hash
  • [ ] Full remote name
  • [ ] Active git branch
  • [ ] Date of the last pull if possible? (eg. as here).
  • [ ] Path to cloned pipeline? _(maybe not desirable to advertise this?)_

I guess that if you go the full distance and print all of this it will be a bit much to show. Perhaps it could have a verbose mode? Or cli arguments for which fields to show?

WIP kinfeature prlow

Most helpful comment

Added -o json|ymal option, eg:

$ nextflow info hello -o yaml
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}
$ nextflow info nextflow-io/hello -o json 
{
    "projectName": "nextflow-io/hello",
    "repository": "https://github.com/nextflow-io/hello",
    "localPath": "https://github.com/nextflow-io/hello",
    "manifest": {
        "mainScript": "main.nf",
        "nextflowVersion": null,
        "author": null,
        "defaultBranch": "master",
        "description": null,
        "gitmodules": null,
        "homePage": null,
        "version": null
    },
    "revisions": {
        "current": "master",
        "master": "master",
        "branches": [
            {
                "name": "master",
                "commitId": "c9b0ec72860c378a214402225fcec2e8bbf23878"
            },
            {
                "name": "mybranch",
                "commitId": "1c3e9e7404127514d69369cd87f8036830f5cf64"
            },
            {
                "name": "testing",
                "commitId": "c36085ebd8a031464c7580910e714bf122903cc1"
            }
        ],
        "tags": [
            {
                "name": "v1.1",
                "commitId": "baba3959d7527e0205738ebeb81373858c775a39"
            },
            {
                "name": "v1.2",
                "commitId": "0ec2ecd0ac13bc7e32594c0258ebce55e383d241"
            }
        ]
    }
}

Moreover I demoted the check for remote changes as optional with the -u option because it takes too long.

$  nextflow info hello -o yaml -u
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, latestId: a9012339ce857d6ec7a078281813d8a93645a3e7, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}

All 6 comments

Apologies, I should really RTFM before creating issues!

nextflow info does basically everything I want 馃憤

Ok - I will modify this request a little then.. Please could we have an option for JSON output? 馃榿

Also, having all of this information with a single call to nextflow list would also be very nice :)

But these are both very minor requests really, so feel free to ignore and close if you would rather!

I think it makes more sense to extend the list command adding a -o flag (output) to support both json and yaml format with the extra information you are proposing.

Added -o json|ymal option, eg:

$ nextflow info hello -o yaml
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}
$ nextflow info nextflow-io/hello -o json 
{
    "projectName": "nextflow-io/hello",
    "repository": "https://github.com/nextflow-io/hello",
    "localPath": "https://github.com/nextflow-io/hello",
    "manifest": {
        "mainScript": "main.nf",
        "nextflowVersion": null,
        "author": null,
        "defaultBranch": "master",
        "description": null,
        "gitmodules": null,
        "homePage": null,
        "version": null
    },
    "revisions": {
        "current": "master",
        "master": "master",
        "branches": [
            {
                "name": "master",
                "commitId": "c9b0ec72860c378a214402225fcec2e8bbf23878"
            },
            {
                "name": "mybranch",
                "commitId": "1c3e9e7404127514d69369cd87f8036830f5cf64"
            },
            {
                "name": "testing",
                "commitId": "c36085ebd8a031464c7580910e714bf122903cc1"
            }
        ],
        "tags": [
            {
                "name": "v1.1",
                "commitId": "baba3959d7527e0205738ebeb81373858c775a39"
            },
            {
                "name": "v1.2",
                "commitId": "0ec2ecd0ac13bc7e32594c0258ebce55e383d241"
            }
        ]
    }
}

Moreover I demoted the check for remote changes as optional with the -u option because it takes too long.

$  nextflow info hello -o yaml -u
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, latestId: a9012339ce857d6ec7a078281813d8a93645a3e7, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}

Included in version 18.12.0-edge.

Was this page helpful?
0 / 5 - 0 ratings